/* Generated by Cython 3.0.11 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "name": "buelon.cython.c_hub",
        "sources": [
            "buelon/cython/c_hub.pyx"
        ]
    },
    "module_name": "buelon.cython.c_hub"
}
END: Cython Metadata */

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

#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.7+ or Python 3.3+.
#else
#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
#define __PYX_EXTRA_ABI_MODULE_NAME "limited"
#else
#define __PYX_EXTRA_ABI_MODULE_NAME ""
#endif
#define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
#define CYTHON_HEX_VERSION 0x03000BF0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #define HAVE_LONG_LONG
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #if PY_VERSION_HEX < 0x03090000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_CLINE_IN_TRACEBACK
  #define CYTHON_CLINE_IN_TRACEBACK 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 1
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #ifndef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS 0
  #endif
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #if PY_VERSION_HEX < 0x030400a1
    #undef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #elif !defined(CYTHON_USE_TP_FINALIZE)
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #if PY_VERSION_HEX < 0x030600B1
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5)
  #endif
  #if PY_VERSION_HEX < 0x030700A3
    #undef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 0
  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS 1
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if !defined(CYTHON_VECTORCALL)
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
#endif
#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_MAJOR_VERSION < 3
    #include "longintrepr.h"
  #endif
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
            typedef unsigned char     uint8_t;
            typedef unsigned short    uint16_t;
            typedef unsigned int      uint32_t;
        #else
            typedef unsigned __int8   uint8_t;
            typedef unsigned __int16  uint16_t;
            typedef unsigned __int32  uint32_t;
        #endif
    #endif
    #if _MSC_VER < 1300
        #ifdef _WIN64
            typedef unsigned long long  __pyx_uintptr_t;
        #else
            typedef unsigned int        __pyx_uintptr_t;
        #endif
    #else
        #ifdef _WIN64
            typedef unsigned __int64    __pyx_uintptr_t;
        #else
            typedef unsigned __int32    __pyx_uintptr_t;
        #endif
    #endif
#else
    #include <stdint.h>
    typedef uintptr_t  __pyx_uintptr_t;
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

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

#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_DefaultClassType PyClass_Type
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
        PyObject *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
        PyObject *version_info;
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
        minor_version = 11;
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
    #ifndef CO_OPTIMIZED
    #define CO_OPTIMIZED 0x0001
    #endif
    #ifndef CO_NEWLOCALS
    #define CO_NEWLOCALS 0x0002
    #endif
    #ifndef CO_VARARGS
    #define CO_VARARGS 0x0004
    #endif
    #ifndef CO_VARKEYWORDS
    #define CO_VARKEYWORDS 0x0008
    #endif
    #ifndef CO_ASYNC_GENERATOR
    #define CO_ASYNC_GENERATOR 0x0200
    #endif
    #ifndef CO_GENERATOR
    #define CO_GENERATOR 0x0020
    #endif
    #ifndef CO_COROUTINE
    #define CO_COROUTINE 0x0080
    #endif
#elif PY_VERSION_HEX >= 0x030B0000
  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
    PyCodeObject *result;
    PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
    if (!empty_bytes) return NULL;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
    Py_DECREF(empty_bytes);
    return result;
  }
#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#endif
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef CO_COROUTINE
  #define CO_COROUTINE 0x80
#endif
#ifndef CO_ASYNC_GENERATOR
  #define CO_ASYNC_GENERATOR 0x200
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#elif CYTHON_BACKPORT_VECTORCALL
  typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
                                            size_t nargsf, PyObject *kwnames);
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  ((size_t)1 << (8 * sizeof(size_t) - 1))
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_MAJOR_VERSION >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if __PYX_LIMITED_VERSION_HEX < 0x030900B1
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if PY_MAJOR_VERSION < 3
    #if CYTHON_COMPILING_IN_PYPY
        #if PYPY_VERSION_NUM < 0x07030600
            #if defined(__cplusplus) && __cplusplus >= 201402L
                [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
            #elif defined(__GNUC__) || defined(__clang__)
                __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
            #elif defined(_MSC_VER)
                __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
            #endif
            static CYTHON_INLINE int PyGILState_Check(void) {
                return 0;
            }
        #else  // PYPY_VERSION_NUM < 0x07030600
        #endif  // PYPY_VERSION_NUM < 0x07030600
    #else
        static CYTHON_INLINE int PyGILState_Check(void) {
            PyThreadState * tstate = _PyThreadState_Current;
            return tstate && (tstate == PyGILState_GetThisThreadState());
        }
    #endif
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  (Py_TYPE(obj)->tp_iternext)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  PyIter_Next
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
#else
  #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
#endif
#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GetLength(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         ((int)PyUnicode_KIND(u))
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((int)sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
    #undef PyUnicode_Contains
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#if CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define __Pyx_Py3Int_Check(op)       PyLong_Check(op)
  #define __Pyx_Py3Int_CheckExact(op)  PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#else
  #define __Pyx_Py3Int_Check(op)       (PyLong_Check(op) || PyInt_Check(op))
  #define __Pyx_Py3Int_CheckExact(op)  (PyLong_CheckExact(op) || PyInt_CheckExact(op))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsHash_t
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsSsize_t
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

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

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

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

#define __PYX_HAVE__buelon__cython__c_hub
#define __PYX_HAVE_API__buelon__cython__c_hub
/* Early includes */
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
#include <string.h>
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = (char) c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#include <string.h>
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


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

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

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

static const char *__pyx_f[] = {
  "buelon/cython/c_hub.pyx",
};
/* #### Code section: utility_code_proto_before_types ### */
/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

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

/*--- Type declarations ---*/
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair;
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr;
struct __pyx_defaults;
typedef struct __pyx_defaults __pyx_defaults;
struct __pyx_defaults1;
typedef struct __pyx_defaults1 __pyx_defaults1;
struct __pyx_defaults2;
typedef struct __pyx_defaults2 __pyx_defaults2;
struct __pyx_defaults3;
typedef struct __pyx_defaults3 __pyx_defaults3;
struct __pyx_defaults4;
typedef struct __pyx_defaults4 __pyx_defaults4;
struct __pyx_defaults {
  PyObject *__pyx_arg_priority;
};
struct __pyx_defaults1 {
  PyObject *__pyx_arg_status;
};
struct __pyx_defaults2 {
  PyObject *__pyx_arg_status;
};
struct __pyx_defaults3 {
  PyObject *__pyx_arg_attempts;
};
struct __pyx_defaults4 {
  PyObject *__pyx_arg_status;
  PyObject *__pyx_arg_min_table_size;
};

/* "buelon/cython/c_hub.pyx":79
 * 
 * 
 * def timeout_func(func, args=None, kwargs=None, timeout_duration=1, default=None):             # <<<<<<<<<<<<<<
 *     if args is None: args = []
 *     if kwargs is None: kwargs = {}
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func {
  PyObject_HEAD
  PyObject *__pyx_v_CustomTimeoutError;
};


/* "buelon/cython/c_hub.pyx":355
 *             print('waiting' + ('.' * (i % 4)))
 *             i += 1
 *             for row in client.get_rows(','.join(row[0] for row in rows)):             # <<<<<<<<<<<<<<
 *                 # print(row)
 *                 if (row['status'] == buelon.core.step.StepStatus.success.name
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_row;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "buelon/cython/c_hub.pyx":715
 * 
 * 
 * def _fetch_errors(self: HubServer, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *     if not isinstance(count, int):
 *         raise ValueError('count must be an integer')
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors {
  PyObject_HEAD
  PyObject *__pyx_v_allow_chars;
  PyObject *__pyx_v_clean_query_string;
};


/* "buelon/cython/c_hub.pyx":723
 * 
 *     if isinstance(exclude, list):
 *         if not all(isinstance(x, str) for x in exclude):             # <<<<<<<<<<<<<<
 *             raise ValueError('exclude must be a list of strings')
 * 
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_x;
};


/* "buelon/cython/c_hub.pyx":728
 *     allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 *     def clean_query_string(query_string: str) -> str:
 *         return ''.join(c for c in query_string if c in allow_chars)             # <<<<<<<<<<<<<<
 * 
 *     exclude_query = ''
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr {
  PyObject_HEAD
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_c;
  PyObject *__pyx_t_0;
  PyObject *(*__pyx_t_1)(PyObject *);
};


/* "buelon/cython/c_hub.pyx":736
 *         exclude_query = (' AND not ('
 *                          + ' OR '.join(
 *                                 f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''             # <<<<<<<<<<<<<<
 *                                 for ex in exclude)
 *                          + ')')
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr {
  PyObject_HEAD
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_ex;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "buelon/cython/c_hub.pyx":788
 *         buelon.core.step.StepStatus: The status of the step.
 *     """
 *     job_ids = '(' + ', '.join((f"'{i}'" for i in job_ids.split(','))) + ')'             # <<<<<<<<<<<<<<
 *     sql = f'''
 * select buj.id, bsm.name
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_i;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "buelon/cython/c_hub.pyx":981
 *         return ThreadPoolExecutor(max_workers=max_connections)
 * 
 *     def execute_db_query(self, query, params=None, json_table=False):             # <<<<<<<<<<<<<<
 *         def db_operation():
 *             with sqlite3.connect(db_path) as conn:
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query {
  PyObject_HEAD
  PyObject *__pyx_v_json_table;
  PyObject *__pyx_v_params;
  PyObject *__pyx_v_query;
};


/* "buelon/cython/c_hub.pyx":1190
 * 
 *                 if isinstance(exclude, list):
 *                     if not all(isinstance(x, str) for x in exclude):             # <<<<<<<<<<<<<<
 *                         raise ValueError('exclude must be a list of strings')
 *             except ValueError:
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_x;
};


/* "buelon/cython/c_hub.pyx":1258
 * 
 *         # Use a single query to fetch all necessary data
 *         query = f"""             # <<<<<<<<<<<<<<
 *         SELECT s.id -- s.id, s.priority, s.scope, s.velocity, s.tag, t.velocity as tag_velocity
 *         FROM steps s
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v__;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "buelon/cython/c_hub.pyx":1287
 *         # Update status to working for selected steps
 *         if steps:
 *             update_query = f"""             # <<<<<<<<<<<<<<
 *             UPDATE steps
 *             SET status = ?, epoch = ?
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v__;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "buelon/cython/c_hub.pyx":1615
 *             # scope_section = f"""s.scope IN ({','.join(f"'{s}'" for s in scopes)})"""
 *             # same as above
 *             scope_section = f"""s.scope = ANY(array[{','.join(f"'{s}'" for s in scopes)}])"""             # <<<<<<<<<<<<<<
 * 
 *         query = f"""
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_s;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "buelon/cython/c_hub.pyx":1697
 *             end = f" id = '{_step.children[0]}'" \
 *                 if len(_step.children) == 1 else \
 *                 f' id IN (' + ', '.join(f"'{_id}'" for _id in _step.children) + ')'             # <<<<<<<<<<<<<<
 *             # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'active\' WHERE {end}")
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v__id;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "buelon/cython/c_hub.pyx":1711
 * 
 *         status = buelon.core.step.StepStatus.success.value
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'             # <<<<<<<<<<<<<<
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE {where}")
 *         children = [c for s in steps for c in s.children]
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_s;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "buelon/cython/c_hub.pyx":1718
 *             end = f" id = '{children[0]}'" \
 *                 if len(children) == 1 else \
 *                 f' id IN (' + ', '.join(f"'{_id}'" for _id in children) + ')'             # <<<<<<<<<<<<<<
 *             # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'active\' WHERE {end}")
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v__id;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "buelon/cython/c_hub.pyx":1738
 *         status = buelon.core.step.StepStatus.pending.value
 * 
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'             # <<<<<<<<<<<<<<
 *         self.db.query(
 *             f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where};")
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_s;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "buelon/cython/c_hub.pyx":1773
 *         __already = set() if first_iteration else __already
 * 
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'             # <<<<<<<<<<<<<<
 *         status = buelon.core.step.StepStatus.cancel.value
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE {where}")
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_s;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "buelon/cython/c_hub.pyx":1817
 *         queued = [s.id for s in steps if s.parents]
 *         if pendings:
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in pendings) + ')'             # <<<<<<<<<<<<<<
 *             status = buelon.core.step.StepStatus.pending.value
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_s;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "buelon/cython/c_hub.pyx":1821
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")
 *         if queued:
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in queued) + ')'             # <<<<<<<<<<<<<<
 *             status = buelon.core.step.StepStatus.queued.value
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_s;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "buelon/cython/c_hub.pyx":1912
 *         db.query('delete from buelon_jobs;')
 * 
 *     def postgres_fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *         try:
 *             count = int(count)
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors {
  PyObject_HEAD
  PyObject *__pyx_v_allow_chars;
  PyObject *__pyx_v_clean_query_string;
};


/* "buelon/cython/c_hub.pyx":1920
 *                 raise ValueError('exclude must be a string or a list')
 * 
 *             if isinstance(exclude, list) and not all(isinstance(x, str) for x in exclude):             # <<<<<<<<<<<<<<
 *                 raise ValueError('exclude must be a list of strings')
 *         except ValueError:
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_x;
};


/* "buelon/cython/c_hub.pyx":1928
 * 
 *         def clean_query_string(query_string: str) -> str:
 *             return ''.join(c for c in query_string if c in allow_chars)             # <<<<<<<<<<<<<<
 * 
 *         exclude_query = ''
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr {
  PyObject_HEAD
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_c;
  PyObject *__pyx_t_0;
  PyObject *(*__pyx_t_1)(PyObject *);
};


/* "buelon/cython/c_hub.pyx":1936
 *             exclude_query = (' AND not ('
 *                              + ' OR '.join(
 *                         f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''             # <<<<<<<<<<<<<<
 *                         for ex in exclude)
 *                              + ')')
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr {
  PyObject_HEAD
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_ex;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "buelon/cython/c_hub.pyx":1957
 *         }
 * 
 *     def postgres_repair(self):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair {
  PyObject_HEAD
  PyObject *__pyx_v_i;
  PyObject *__pyx_v_parent_statuses;
  PyObject *__pyx_v_self;
};


/* "buelon/cython/c_hub.pyx":1981
 *         def should_finish(s: buelon.core.step.Step):
 *             # return all(parent_statuses[p] in [f'{buelon.core.step.StepStatus.success.value}', f'{buelon.core.step.StepStatus.cancel.value}'] for p in s.parents)
 *             return all(parent_statuses[p] == f'{buelon.core.step.StepStatus.success.value}' for p in s.parents)             # <<<<<<<<<<<<<<
 * 
 *         chunk = []
 */
struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr {
  PyObject_HEAD
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_p;
};

/* #### Code section: utility_code_proto ### */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* 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) :\
         (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\
            (PY_VERSION_HEX >= 0x030700A0 ?\
                (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\
                (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\
          (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\
            (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\
            (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ?  ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(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

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

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

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

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

/* 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
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);

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

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

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

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

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

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

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

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

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

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

/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
    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
}

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

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

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

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

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

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

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

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

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

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

/* PyObject_Str.proto */
#define __Pyx_PyObject_Str(obj)\
    (likely(PyString_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))

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

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

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

/* CallableCheck.proto */
#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3
#define __Pyx_PyCallable_Check(obj)   (Py_TYPE(obj)->tp_call != NULL)
#else
#define __Pyx_PyCallable_Check(obj)   PyCallable_Check(obj)
#endif

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

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

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

/* RaiseMappingExpected.proto */
static void __Pyx_RaiseMappingExpectedError(PyObject* arg);

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

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

/* bytes_tailmatch.proto */
static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg,
                                         Py_ssize_t start, Py_ssize_t end, int direction);
static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr,
                                   Py_ssize_t start, Py_ssize_t end, int direction);

/* unicode_tailmatch.proto */
static int __Pyx_PyUnicode_Tailmatch(
    PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction);

/* str_tailmatch.proto */
static CYTHON_INLINE int __Pyx_PyStr_Tailmatch(PyObject* self, PyObject* arg, Py_ssize_t start,
                                               Py_ssize_t end, int direction);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* #### Code section: module_declarations ### */

/* Module declarations from "buelon.cython.c_hub" */
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "buelon.cython.c_hub"
extern int __pyx_module_is_main_buelon__cython__c_hub;
int __pyx_module_is_main_buelon__cython__c_hub = 0;

/* Implementation of "buelon.cython.c_hub" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_all;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_OSError;
static PyObject *__pyx_builtin_exit;
static PyObject *__pyx_builtin_KeyboardInterrupt;
static PyObject *__pyx_builtin_AttributeError;
/* #### Code section: string_decls ### */
static const char __pyx_k_0[] = "', 0);";
static const char __pyx_k_F[] = "\033[F";
static const char __pyx_k_K[] = "\033[K";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_e[] = "e";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_p[] = "p";
static const char __pyx_k_q[] = "q";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_s[] = "s";
static const char __pyx_k_v[] = "v";
static const char __pyx_k_OR[] = " OR ";
static const char __pyx_k__3[] = "";
static const char __pyx_k__4[] = "`";
static const char __pyx_k__8[] = "'";
static const char __pyx_k__9[] = "'\n    ";
static const char __pyx_k_db[] = "db";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_ok[] = "ok";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_qs[] = "qs";
static const char __pyx_k_ss[] = "ss";
static const char __pyx_k_Any[] = "Any";
static const char __pyx_k__10[] = ";";
static const char __pyx_k__11[] = "*";
static const char __pyx_k__12[] = "', \n                '";
static const char __pyx_k__13[] = "'\n            )\n        ";
static const char __pyx_k__14[] = ".";
static const char __pyx_k__15[] = ",";
static const char __pyx_k__16[] = "';";
static const char __pyx_k__20[] = "/";
static const char __pyx_k__21[] = ", ";
static const char __pyx_k__22[] = "?";
static const char __pyx_k__23[] = ")";
static const char __pyx_k__24[] = "%'";
static const char __pyx_k__30[] = "%')";
static const char __pyx_k__31[] = "' ";
static const char __pyx_k__32[] = "(";
static const char __pyx_k__33[] = " ";
static const char __pyx_k__34[] = "') ";
static const char __pyx_k__35[] = "'    ";
static const char __pyx_k__39[] = ":";
static const char __pyx_k__42[] = ")\n            ";
static const char __pyx_k__44[] = "')";
static const char __pyx_k__45[] = "])";
static const char __pyx_k__48[] = "', \n                    '";
static const char __pyx_k__49[] = "'\n                )\n            ";
static const char __pyx_k__50[] = "'\n            ";
static const char __pyx_k__68[] = "|-**-|";
static const char __pyx_k__69[] = "[-_-]";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_all[] = "all";
static const char __pyx_k_cur[] = "cur";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_env[] = ".env";
static const char __pyx_k_exc[] = "exc";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_hub[] = "hub";
static const char __pyx_k_ids[] = "ids";
static const char __pyx_k_int[] = "int";
static const char __pyx_k_job[] = "job";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_msg[] = "msg";
static const char __pyx_k_put[] = "put";
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_str[] = "str";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_tag[] = "tag";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k_DONE[] = "DONE";
static const char __pyx_k_Done[] = "Done";
static const char __pyx_k_Enum[] = "Enum";
static const char __pyx_k_Lock[] = "Lock";
static const char __pyx_k_None[] = "None";
static const char __pyx_k_Port[] = "Port ";
static const char __pyx_k_Step[] = "Step";
static const char __pyx_k_addr[] = "addr";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_bind[] = "bind";
static const char __pyx_k_bool[] = "bool";
static const char __pyx_k_bulk[] = "bulk";
static const char __pyx_k_code[] = "code";
static const char __pyx_k_conn[] = "conn";
static const char __pyx_k_core[] = "core";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_desc[] = "desc";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_done[] = "_done";
static const char __pyx_k_enum[] = "enum";
static const char __pyx_k_exit[] = "exit";
static const char __pyx_k_fail[] = "__fail__";
static const char __pyx_k_func[] = "func";
static const char __pyx_k_host[] = "host";
static const char __pyx_k_id_2[] = " id = '";
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_list[] = "list";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_port[] = "port";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_recv[] = "recv";
static const char __pyx_k_rows[] = "rows";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_spec[] = "__spec__";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_sync[] = "sync_";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_tqdm[] = "tqdm";
static const char __pyx_k_true[] = "true";
static const char __pyx_k_uuid[] = "uuid";
static const char __pyx_k_warn[] = "warn";
static const char __pyx_k_ERROR[] = "ERROR";
static const char __pyx_k_Error[] = "Error:";
static const char __pyx_k_LIMIT[] = " LIMIT ?";
static const char __pyx_k_Queue[] = "Queue";
static const char __pyx_k_RESET[] = "RESET";
static const char __pyx_k_alarm[] = "alarm";
static const char __pyx_k_bytes[] = "bytes";
static const char __pyx_k_child[] = "child";
static const char __pyx_k_chunk[] = "chunk";
static const char __pyx_k_clear[] = "clear";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_count[] = "count";
static const char __pyx_k_dones[] = "dones";
static const char __pyx_k_dumps[] = "dumps";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_epoch[] = "', epoch = ";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_false[] = "false";
static const char __pyx_k_frame[] = "frame";
static const char __pyx_k_id_IN[] = " id IN (";
static const char __pyx_k_id_in[] = "id in (";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_limit[] = "limit";
static const char __pyx_k_loads[] = "loads";
static const char __pyx_k_local[] = "local";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_qsize[] = "qsize";
static const char __pyx_k_query[] = "query";
static const char __pyx_k_queue[] = "queue";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_reset[] = "_reset";
static const char __pyx_k_scope[] = "scope";
static const char __pyx_k_sleep[] = "sleep";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_steps[] = "steps";
static const char __pyx_k_strip[] = "strip";
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_total[] = "total";
static const char __pyx_k_trace[] = "trace";
static const char __pyx_k_types[] = "types";
static const char __pyx_k_uuid1[] = "uuid1";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_where[] = "where";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_CANCEL[] = "CANCEL";
static const char __pyx_k_Client[] = "Client";
static const char __pyx_k_Method[] = "Method";
static const char __pyx_k_Thread[] = "Thread";
static const char __pyx_k_accept[] = "accept";
static const char __pyx_k_active[] = "active";
static const char __pyx_k_amount[] = "amount";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_bucket[] = "bucket";
static const char __pyx_k_buelon[] = "buelon";
static const char __pyx_k_cancel[] = "cancel";
static const char __pyx_k_client[] = "client";
static const char __pyx_k_commit[] = "commit";
static const char __pyx_k_config[] = "config";
static const char __pyx_k_cursor[] = "cursor";
static const char __pyx_k_daemon[] = "daemon";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_delete[] = "delete";
static const char __pyx_k_dict_2[] = "dict";
static const char __pyx_k_done_2[] = "done";
static const char __pyx_k_dotenv[] = "dotenv";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_errors[] = "errors";
static const char __pyx_k_exc_tb[] = "exc_tb";
static const char __pyx_k_exit_2[] = "__exit__";
static const char __pyx_k_extras[] = "extras";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_listen[] = "listen";
static const char __pyx_k_main_2[] = "main";
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_offset[] = "offset";
static const char __pyx_k_output[] = "output";
static const char __pyx_k_params[] = "params";
static const char __pyx_k_parent[] = "parent";
static const char __pyx_k_queued[] = "queued";
static const char __pyx_k_repair[] = "repair";
static const char __pyx_k_resets[] = "resets";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_return[] = "return";
static const char __pyx_k_scopes[] = "scopes";
static const char __pyx_k_server[] = "server";
static const char __pyx_k_signal[] = "signal";
static const char __pyx_k_signum[] = "signum";
static const char __pyx_k_socket[] = "socket";
static const char __pyx_k_status[] = "status";
static const char __pyx_k_stdout[] = "stdout";
static const char __pyx_k_step_2[] = "_step";
static const char __pyx_k_step_3[] = "step/";
static const char __pyx_k_string[] = "string";
static const char __pyx_k_submit[] = "submit";
static const char __pyx_k_suffix[] = "suffix";
static const char __pyx_k_system[] = "system";
static const char __pyx_k_target[] = "target";
static const char __pyx_k_thread[] = "thread";
static const char __pyx_k_typing[] = "typing";
static const char __pyx_k_unsync[] = "unsync";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_worker[] = "worker";
static const char __pyx_k_0_0_0_0[] = "0.0.0.0";
static const char __pyx_k_AF_INET[] = "AF_INET";
static const char __pyx_k_AND_not[] = " AND not (";
static const char __pyx_k_LIMIT_2[] = "\n        LIMIT ?\n        ";
static const char __pyx_k_LIMIT_3[] = "\n                    LIMIT ";
static const char __pyx_k_LIMIT_4[] = "\n                LIMIT ";
static const char __pyx_k_LIMIT_5[] = "  LIMIT ";
static const char __pyx_k_OSError[] = "OSError";
static const char __pyx_k_PENDING[] = "PENDING";
static const char __pyx_k_SIGALRM[] = "SIGALRM";
static const char __pyx_k_Windows[] = "Windows";
static const char __pyx_k_already[] = "already";
static const char __pyx_k_asyncio[] = "asyncio";
static const char __pyx_k_attempt[] = "attempt";
static const char __pyx_k_cancels[] = "cancels";
static const char __pyx_k_connect[] = "connect";
static const char __pyx_k_db_path[] = "db_path";
static const char __pyx_k_db_pool[] = "db_pool";
static const char __pyx_k_default[] = "default";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_environ[] = "environ";
static const char __pyx_k_error_2[] = "_error";
static const char __pyx_k_error_3[] = " error: ";
static const char __pyx_k_exc_val[] = "exc_val";
static const char __pyx_k_exclude[] = "exclude";
static const char __pyx_k_execute[] = "execute";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_getattr[] = "__getattr__";
static const char __pyx_k_handler[] = "handler";
static const char __pyx_k_headers[] = "headers";
static const char __pyx_k_helpers[] = "helpers";
static const char __pyx_k_inspect[] = "inspect";
static const char __pyx_k_job_ids[] = "job_ids";
static const char __pyx_k_key_map[] = "key_map";
static const char __pyx_k_load_db[] = "load_db";
static const char __pyx_k_load_pg[] = "load_pg";
static const char __pyx_k_msg_msg[] = ", \n             msg = $msg$";
static const char __pyx_k_new_key[] = "new_key";
static const char __pyx_k_nothing[] = "nothing";
static const char __pyx_k_parents[] = "parents";
static const char __pyx_k_payload[] = "payload";
static const char __pyx_k_pending[] = "pending";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_receive[] = "receive";
static const char __pyx_k_request[] = "request";
static const char __pyx_k_reset_2[] = "reset";
static const char __pyx_k_retries[] = "retries";
static const char __pyx_k_reverse[] = "reverse";
static const char __pyx_k_s_scope[] = "s.scope = '";
static const char __pyx_k_seconds[] = " seconds";
static const char __pyx_k_sendall[] = "sendall";
static const char __pyx_k_sqlite3[] = "sqlite3";
static const char __pyx_k_step_id[] = "step_id";
static const char __pyx_k_success[] = "success";
static const char __pyx_k_timeout[] = "timeout";
static const char __pyx_k_to_json[] = "to_json";
static const char __pyx_k_waiting[] = "waiting";
static const char __pyx_k_working[] = "working";
static const char __pyx_k_Callable[] = "Callable";
static const char __pyx_k_ORDER_BY[] = ")ORDER BY     ";
static const char __pyx_k_attempts[] = "attempts";
static const char __pyx_k_bulk_get[] = "bulk_get";
static const char __pyx_k_bulk_set[] = "bulk_set";
static const char __pyx_k_cancel_2[] = "_cancel";
static const char __pyx_k_children[] = "children";
static const char __pyx_k_endswith[] = "endswith";
static const char __pyx_k_exc_type[] = "exc_type";
static const char __pyx_k_fetchall[] = "fetchall";
static const char __pyx_k_get_data[] = "get_data";
static const char __pyx_k_get_rows[] = "get_rows";
static const char __pyx_k_get_step[] = "get_step";
static const char __pyx_k_list_str[] = "list[str]";
static const char __pyx_k_new_bulk[] = "new_bulk";
static const char __pyx_k_or_epoch[] = " or (epoch < ";
static const char __pyx_k_order_by[] = "order_by";
static const char __pyx_k_pendings[] = "pendings";
static const char __pyx_k_platform[] = "platform";
static const char __pyx_k_postgres[] = "postgres";
static const char __pyx_k_priority[] = "priority";
static const char __pyx_k_psycopg2[] = "psycopg2";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_received[] = "received";
static const char __pyx_k_response[] = "response";
static const char __pyx_k_set_None[] = "set | None";
static const char __pyx_k_set_data[] = "set_data";
static const char __pyx_k_set_name[] = "__set_name__";
static const char __pyx_k_set_step[] = "set_step";
static const char __pyx_k_shutdown[] = "shutdown";
static const char __pyx_k_statuses[] = "statuses";
static const char __pyx_k_step_ids[] = "step_ids";
static const char __pyx_k_str_None[] = "str | None";
static const char __pyx_k_tag_lock[] = "tag_lock";
static const char __pyx_k_velocity[] = "velocity";
static const char __pyx_k_warnings[] = "warnings";
static const char __pyx_k_GET_STEPS[] = "GET_STEPS";
static const char __pyx_k_HubClient[] = "HubClient";
static const char __pyx_k_HubServer[] = "HubServer";
static const char __pyx_k_SHUT_RDWR[] = "SHUT_RDWR";
static const char __pyx_k_WHEN_THEN[] = "WHEN ? THEN ";
static const char __pyx_k_already_2[] = "__already";
static const char __pyx_k_executing[] = "executing";
static const char __pyx_k_file_path[] = "file_path";
static const char __pyx_k_from_json[] = "from_json";
static const char __pyx_k_get_queue[] = "_get_queue";
static const char __pyx_k_get_steps[] = "get_steps";
static const char __pyx_k_id_column[] = "id_column";
static const char __pyx_k_int_float[] = "int | float";
static const char __pyx_k_isenabled[] = "isenabled";
static const char __pyx_k_list_None[] = "list | None";
static const char __pyx_k_list_dict[] = "list[dict]";
static const char __pyx_k_localhost[] = "localhost";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_or_status[] = " or status = '";
static const char __pyx_k_pending_2[] = "_pending";
static const char __pyx_k_print_exc[] = "print_exc";
static const char __pyx_k_set_steps[] = "set_steps";
static const char __pyx_k_step_data[] = "step-data/";
static const char __pyx_k_step_json[] = "step_json";
static const char __pyx_k_tag_usage[] = "tag_usage";
static const char __pyx_k_task_done[] = "task_done";
static const char __pyx_k_threading[] = "threading";
static const char __pyx_k_traceback[] = "traceback";
static const char __pyx_k_AND_status[] = ") AND (   status = '";
static const char __pyx_k_FETCH_ROWS[] = "FETCH_ROWS";
static const char __pyx_k_ORDER_BY_2[] = ")\n        ORDER BY ";
static const char __pyx_k_ORDER_BY_3[] = ")\n                    ORDER BY ";
static const char __pyx_k_ORDER_BY_4[] = ")\n                ORDER BY ";
static const char __pyx_k_STEP_COUNT[] = "STEP_COUNT";
static const char __pyx_k_StepStatus[] = "StepStatus";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_and_status[] = "      and status = '";
static const char __pyx_k_chunk_size[] = "chunk_size";
static const char __pyx_k_error_size[] = "error_size";
static const char __pyx_k_fetch_rows[] = "fetch-rows";
static const char __pyx_k_increments[] = "increments";
static const char __pyx_k_json_table[] = "json_table";
static const char __pyx_k_lazy_steps[] = "lazy_steps";
static const char __pyx_k_new_output[] = "new_output";
static const char __pyx_k_pipe_debug[] = "pipe_debug";
static const char __pyx_k_processing[] = "processing";
static const char __pyx_k_setsockopt[] = "setsockopt";
static const char __pyx_k_settimeout[] = "settimeout";
static const char __pyx_k_step_count[] = "step-count";
static const char __pyx_k_step_jsons[] = "step_jsons";
static const char __pyx_k_IPPROTO_TCP[] = "IPPROTO_TCP";
static const char __pyx_k_SOCK_STREAM[] = "SOCK_STREAM";
static const char __pyx_k_SQLiteQueue[] = "SQLiteQueue";
static const char __pyx_k_TCP_NODELAY[] = "TCP_NODELAY";
static const char __pyx_k_UPLOAD_STEP[] = "UPLOAD_STEP";
static const char __pyx_k_WHERE_id_IN[] = " WHERE id IN (";
static const char __pyx_k_WORKER_HOST[] = "WORKER_HOST";
static const char __pyx_k_WORKER_PORT[] = "WORKER_PORT";
static const char __pyx_k_allow_chars[] = "allow_chars";
static const char __pyx_k_auto_commit[] = "auto_commit";
static const char __pyx_k_collections[] = "collections";
static const char __pyx_k_database_db[] = "database.db";
static const char __pyx_k_defaultdict[] = "defaultdict";
static const char __pyx_k_description[] = "description";
static const char __pyx_k_get_steps_2[] = "get-steps";
static const char __pyx_k_job_handler[] = "job_handler";
static const char __pyx_k_json_parser[] = "json_parser";
static const char __pyx_k_load_dotenv[] = "load_dotenv";
static const char __pyx_k_max_workers[] = "max_workers";
static const char __pyx_k_mro_entries[] = "__mro_entries__";
static const char __pyx_k_remove_data[] = "remove_data";
static const char __pyx_k_remove_step[] = "remove_step";
static const char __pyx_k_submit_jobs[] = "submit-jobs/";
static const char __pyx_k_upload_step[] = "upload-step";
static const char __pyx_k_AND_s_status[] = ")\n        AND (s.status = ? ";
static const char __pyx_k_AND_status_2[] = ") AND status = '";
static const char __pyx_k_DELETE_STEPS[] = "DELETE_STEPS";
static const char __pyx_k_FETCH_ERRORS[] = "FETCH_ERRORS";
static const char __pyx_k_LIMIT_OFFSET[] = " LIMIT ? OFFSET ?";
static const char __pyx_k_RESET_ERRORS[] = "RESET_ERRORS";
static const char __pyx_k_TimeoutError[] = "TimeoutError";
static const char __pyx_k_UPLOAD_STEPS[] = "UPLOAD_STEPS";
static const char __pyx_k_db_operation[] = "db_operation";
static const char __pyx_k_delete_steps[] = "delete-steps";
static const char __pyx_k_dict_str_Any[] = "dict[str, Any]";
static const char __pyx_k_fetch_errors[] = "_fetch_errors";
static const char __pyx_k_get_statuses[] = "get_statuses";
static const char __pyx_k_initializing[] = "_initializing";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
static const char __pyx_k_persistqueue[] = "persistqueue";
static const char __pyx_k_query_string[] = "query_string";
static const char __pyx_k_reset_errors[] = "reset-errors";
static const char __pyx_k_send_request[] = "send_request";
static const char __pyx_k_status_value[] = "status_value";
static const char __pyx_k_timeout_func[] = "timeout_func";
static const char __pyx_k_update_query[] = "update_query";
static const char __pyx_k_upload_steps[] = "upload_steps";
static const char __pyx_k_upload_table[] = "upload_table";
static const char __pyx_k_velocity_sql[] = "velocity_sql";
static const char __pyx_k_where_status[] = "' \n    where status = '";
static const char __pyx_k_PIPELINE_HOST[] = "PIPELINE_HOST";
static const char __pyx_k_PIPELINE_PORT[] = "PIPELINE_PORT";
static const char __pyx_k_asyncio_tasks[] = "asyncio.tasks";
static const char __pyx_k_bucket_client[] = "bucket_client";
static const char __pyx_k_buelon_bucket[] = "buelon.bucket";
static const char __pyx_k_bulk_get_data[] = "bulk_get_data";
static const char __pyx_k_bulk_get_step[] = "bulk_get_step";
static const char __pyx_k_bulk_set_data[] = "bulk_set_data";
static const char __pyx_k_callable_None[] = "callable | None";
static const char __pyx_k_class_getitem[] = "__class_getitem__";
static const char __pyx_k_client_socket[] = "client_socket";
static const char __pyx_k_client_thread[] = "client_thread";
static const char __pyx_k_exclude_query[] = "exclude_query";
static const char __pyx_k_execute_batch[] = "execute_batch";
static const char __pyx_k_handle_client[] = "_handle_client";
static const char __pyx_k_init_subclass[] = "__init_subclass__";
static const char __pyx_k_postgres_done[] = "postgres_done";
static const char __pyx_k_scope_section[] = "scope_section";
static const char __pyx_k_should_finish[] = "should_finish";
static const char __pyx_k_socket_socket[] = "socket.socket";
static const char __pyx_k_status_values[] = "status_values";
static const char __pyx_k_update_params[] = "update_params";
static const char __pyx_k_upload_step_2[] = "_upload_step";
static const char __pyx_k_upload_step_3[] = "upload_step";
static const char __pyx_k_worker_thread[] = "worker_thread";
static const char __pyx_k_AND_s_status_2[] = "\n                    AND (s.status = '";
static const char __pyx_k_AND_s_status_3[] = "\n                AND (s.status = '";
static const char __pyx_k_AttributeError[] = "AttributeError";
static const char __pyx_k_DEFAULT_SCOPES[] = "DEFAULT_SCOPES";
static const char __pyx_k_HubClient_done[] = "HubClient.done";
static const char __pyx_k_Invalid_method[] = "Invalid method: ";
static const char __pyx_k_Max_errors_met[] = "Max errors met";
static const char __pyx_k_USING_POSTGRES[] = "USING_POSTGRES";
static const char __pyx_k_Uploading_Jobs[] = "Uploading Jobs";
static const char __pyx_k_case_statement[] = "case_statement";
static const char __pyx_k_create_db_pool[] = "create_db_pool";
static const char __pyx_k_delete_steps_2[] = "_delete_steps";
static const char __pyx_k_delete_steps_3[] = "delete_steps";
static const char __pyx_k_download_table[] = "download_table";
static const char __pyx_k_epoch_WHERE_id[] = "', epoch = ? WHERE id = ?";
static const char __pyx_k_fetch_errors_2[] = "fetch-errors";
static const char __pyx_k_fetch_errors_3[] = "fetch_errors";
static const char __pyx_k_get_step_count[] = "_get_step_count";
static const char __pyx_k_lower_msg_like[] = "lower(msg) like '%";
static const char __pyx_k_min_table_size[] = "min_table_size";
static const char __pyx_k_postgres_dones[] = "postgres_dones";
static const char __pyx_k_postgres_error[] = "postgres_error";
static const char __pyx_k_postgres_reset[] = "postgres_reset";
static const char __pyx_k_reset_errors_2[] = "reset_errors";
static const char __pyx_k_reset_errors_3[] = "_reset_errors";
static const char __pyx_k_return_job_ids[] = "return_job_ids";
static const char __pyx_k_tag_velocities[] = "tag_velocities";
static const char __pyx_k_upload_steps_2[] = "_upload_steps";
static const char __pyx_k_upload_steps_3[] = "upload-steps";
static const char __pyx_k_where_status_2[] = "'\n            where status = '";
static const char __pyx_k_working_clause[] = "working_clause";
static const char __pyx_k_HubClient_close[] = "HubClient.close";
static const char __pyx_k_HubClient_dones[] = "HubClient.dones";
static const char __pyx_k_HubClient_error[] = "HubClient.error";
static const char __pyx_k_HubClient_reset[] = "HubClient.reset";
static const char __pyx_k_HubServer_start[] = "HubServer.start";
static const char __pyx_k_children_params[] = "children_params";
static const char __pyx_k_execute_request[] = "_execute_request";
static const char __pyx_k_execution_queue[] = "execution_queue";
static const char __pyx_k_executor_thread[] = "executor_thread";
static const char __pyx_k_expiration_time[] = "expiration_time";
static const char __pyx_k_first_iteration[] = "first_iteration";
static const char __pyx_k_get_step_status[] = "get_step_status";
static const char __pyx_k_group_by_status[] = "\n    group by \n        status;\n    ";
static const char __pyx_k_include_workers[] = "include_workers";
static const char __pyx_k_include_working[] = "include_working";
static const char __pyx_k_lazy_load_class[] = "lazy_load_class";
static const char __pyx_k_max_connections[] = "max_connections";
static const char __pyx_k_msg_trace_trace[] = "$msg$, trace = $trace$";
static const char __pyx_k_parent_statuses[] = "parent_statuses";
static const char __pyx_k_postgres_cancel[] = "postgres_cancel";
static const char __pyx_k_postgres_repair[] = "postgres_repair";
static const char __pyx_k_postgres_resets[] = "postgres_resets";
static const char __pyx_k_process_request[] = "_process_request";
static const char __pyx_k_reset_tag_usage[] = "reset_tag_usage";
static const char __pyx_k_sql_update_step[] = "sql_update_step";
static const char __pyx_k_HubClient___exit[] = "HubClient.__exit__";
static const char __pyx_k_HubClient___init[] = "HubClient.__init__";
static const char __pyx_k_HubClient_cancel[] = "HubClient.cancel";
static const char __pyx_k_HubClient_repair[] = "HubClient.repair";
static const char __pyx_k_HubClient_resets[] = "HubClient.resets";
static const char __pyx_k_HubServer___init[] = "HubServer.__init__";
static const char __pyx_k_PIPE_WORKER_HOST[] = "PIPE_WORKER_HOST";
static const char __pyx_k_PIPE_WORKER_PORT[] = "PIPE_WORKER_PORT";
static const char __pyx_k_buelon_core_step[] = "buelon.core.step";
static const char __pyx_k_connection_queue[] = "connection_queue";
static const char __pyx_k_delete_last_line[] = "delete_last_line";
static const char __pyx_k_error_size_query[] = "error_size_query";
static const char __pyx_k_execute_db_query[] = "execute_db_query";
static const char __pyx_k_get_job_statuses[] = "get_job_statuses";
static const char __pyx_k_get_step_count_2[] = "get_step_count";
static const char __pyx_k_pipe_interpreter[] = "pipe_interpreter";
static const char __pyx_k_postgres_cancels[] = "postgres_cancels";
static const char __pyx_k_postgres_pending[] = "postgres_pending";
static const char __pyx_k_submit_pipe_code[] = "submit_pipe_code";
static const char __pyx_k_timeout_duration[] = "timeout_duration";
static const char __pyx_k_upload_pipe_code[] = "upload_pipe_code";
static const char __pyx_k_waiting_priority[] = "waiting_priority";
static const char __pyx_k_HubClient___enter[] = "HubClient.__enter__";
static const char __pyx_k_HubClient_cancels[] = "HubClient.cancels";
static const char __pyx_k_HubClient_connect[] = "HubClient.connect";
static const char __pyx_k_HubClient_load_pg[] = "HubClient.load_pg";
static const char __pyx_k_HubClient_pending[] = "HubClient.pending";
static const char __pyx_k_KeyboardInterrupt[] = "KeyboardInterrupt";
static const char __pyx_k_buelon_status_map[] = "buelon_status_map";
static const char __pyx_k_delete_from_steps[] = "delete from steps;";
static const char __pyx_k_epoch_WHERE_id_IN[] = "', epoch = ? WHERE id IN (";
static const char __pyx_k_finished_statuses[] = "finished_statuses";
static const char __pyx_k_group_by_status_2[] = "\n        group by \n            status;\n        ";
static const char __pyx_k_list_str_str_None[] = "list[str] | str | None";
static const char __pyx_k_postgres_get_rows[] = "postgres_get_rows";
static const char __pyx_k_postgres_pendings[] = "postgres_pendings";
static const char __pyx_k_return_job_def_id[] = "return_job_def_id";
static const char __pyx_k_s_scope_ANY_array[] = "s.scope = ANY(array[";
static const char __pyx_k_setdefaulttimeout[] = "setdefaulttimeout";
static const char __pyx_k_str_list_str_None[] = "str | list[str] | None";
static const char __pyx_k_transaction_queue[] = "transaction_queue";
static const char __pyx_k_wait_until_finish[] = "wait_until_finish";
static const char __pyx_k_CustomTimeoutError[] = "CustomTimeoutError";
static const char __pyx_k_HubClient__already[] = "_HubClient__already";
static const char __pyx_k_HubClient_get_rows[] = "HubClient.get_rows";
static const char __pyx_k_HubClient_pendings[] = "HubClient.pendings";
static const char __pyx_k_PIPELINE_END_TOKEN[] = "PIPELINE_END_TOKEN";
static const char __pyx_k_ThreadPoolExecutor[] = "ThreadPoolExecutor";
static const char __pyx_k_USING_POSTGRES_HUB[] = "USING_POSTGRES_HUB";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_check_active_state[] = "check_active_state";
static const char __pyx_k_clean_query_string[] = "clean_query_string";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_concurrent_futures[] = "concurrent.futures";
static const char __pyx_k_int_float_Callable[] = "int | float | Callable";
static const char __pyx_k_postgres_get_steps[] = "postgres_get_steps";
static const char __pyx_k_priority_ASC_epoch[] = "priority ASC, epoch";
static const char __pyx_k_priority_asc_epoch[] = "priority asc, epoch";
static const char __pyx_k_sql_set_to_working[] = "sql_set_to_working";
static const char __pyx_k_HubClient___getattr[] = "HubClient.__getattr__";
static const char __pyx_k_HubClient_get_steps[] = "HubClient.get_steps";
static const char __pyx_k_HubServer_get_steps[] = "HubServer.get_steps";
static const char __pyx_k_ModuleNotFoundError[] = "ModuleNotFoundError";
static const char __pyx_k_OR_lower_trace_like[] = "%' OR lower(trace) like '%";
static const char __pyx_k_Server_listening_on[] = "Server listening on ";
static const char __pyx_k_buelon_cython_c_hub[] = "buelon.cython.c_hub";
static const char __pyx_k_decrement_tag_usage[] = "decrement_tag_usage";
static const char __pyx_k_execute_transaction[] = "_execute_transaction";
static const char __pyx_k_priority_DESC_epoch[] = "priority DESC, epoch";
static const char __pyx_k_priority_desc_epoch[] = "priority desc, epoch";
static const char __pyx_k_sql_update_children[] = "sql_update_children";
static const char __pyx_k_state_waiting_WHERE[] = ", state='waiting' WHERE ";
static const char __pyx_k_where_status_not_in[] = "\n        where \n            status not in (\n                '";
static const char __pyx_k_PIPELINE_SPLIT_TOKEN[] = "PIPELINE_SPLIT_TOKEN";
static const char __pyx_k_postgres_upload_step[] = "postgres_upload_step";
static const char __pyx_k_process_transactions[] = "_process_transactions";
static const char __pyx_k_state_archived_WHERE[] = ", state='archived' WHERE ";
static const char __pyx_k_HubClient_upload_step[] = "HubClient.upload_step";
static const char __pyx_k_InsufficientPrivilege[] = "InsufficientPrivilege";
static const char __pyx_k_ThreadSafeSQLiteQueue[] = "ThreadSafeSQLiteQueue";
static const char __pyx_k_buelon_core_step_Step[] = "buelon.core.step.Step";
static const char __pyx_k_get_postgres_from_env[] = "get_postgres_from_env";
static const char __pyx_k_postgres_delete_steps[] = "postgres_delete_steps";
static const char __pyx_k_postgres_fetch_errors[] = "postgres_fetch_errors";
static const char __pyx_k_postgres_reset_errors[] = "postgres_reset_errors";
static const char __pyx_k_postgres_upload_steps[] = "postgres_upload_steps";
static const char __pyx_k_where_status_not_in_2[] = "\n            where \n                status not in (\n                    '";
static const char __pyx_k_AND_not_lower_msg_like[] = " AND not (lower(msg) like '%";
static const char __pyx_k_ConnectionRefusedError[] = "ConnectionRefusedError";
static const char __pyx_k_FOR_UPDATE_SKIP_LOCKED[] = "\n                    FOR UPDATE SKIP LOCKED\n                );";
static const char __pyx_k_HubClient_delete_steps[] = "HubClient.delete_steps";
static const char __pyx_k_HubClient_fetch_errors[] = "HubClient.fetch_errors";
static const char __pyx_k_HubClient_reset_errors[] = "HubClient.reset_errors";
static const char __pyx_k_HubClient_send_request[] = "HubClient.send_request";
static const char __pyx_k_HubClient_upload_steps[] = "HubClient.upload_steps";
static const char __pyx_k_Invalid_value_received[] = "Invalid value received: `";
static const char __pyx_k_No_data_found_for_step[] = "No data found for step ";
static const char __pyx_k_buelon_core_pipe_debug[] = "buelon.core.pipe_debug";
static const char __pyx_k_max_reconnect_attempts[] = "max_reconnect_attempts";
static const char __pyx_k_state_waiting_WHERE_id[] = ", state='waiting' WHERE id = '";
static const char __pyx_k_HubClient_postgres_done[] = "HubClient.postgres_done";
static const char __pyx_k_PRAGMA_journal_mode_WAL[] = "PRAGMA journal_mode=WAL";
static const char __pyx_k_Request_timed_out_after[] = "Request timed out after ";
static const char __pyx_k_UPDATE_steps_SET_status[] = "UPDATE steps SET status = '";
static const char __pyx_k_buelon_cython_c_hub_pyx[] = "buelon/cython/c_hub.pyx";
static const char __pyx_k_delete_from_buelon_jobs[] = "delete from buelon_jobs;";
static const char __pyx_k_postgres_get_step_count[] = "postgres_get_step_count";
static const char __pyx_k_state_archived_WHERE_id[] = ", state='archived' WHERE id = '";
static const char __pyx_k_update_steps_set_status[] = "\n    update steps \n    set status = '";
static const char __pyx_k_HubClient_get_step_count[] = "HubClient.get_step_count";
static const char __pyx_k_HubClient_postgres_dones[] = "HubClient.postgres_dones";
static const char __pyx_k_HubClient_postgres_error[] = "HubClient.postgres_error";
static const char __pyx_k_HubClient_postgres_reset[] = "HubClient.postgres_reset";
static const char __pyx_k_HubServer__handle_client[] = "HubServer._handle_client";
static const char __pyx_k_HubServer_create_db_pool[] = "HubServer.create_db_pool";
static const char __pyx_k_count_must_be_an_integer[] = "count must be an integer";
static const char __pyx_k_epoch_msg_trace_WHERE_id[] = "', epoch = ?, msg = ?, trace = ? WHERE id = ?";
static const char __pyx_k_generate_steps_from_code[] = "generate_steps_from_code";
static const char __pyx_k_HubClient_postgres_cancel[] = "HubClient.postgres_cancel";
static const char __pyx_k_HubClient_postgres_repair[] = "HubClient.postgres_repair";
static const char __pyx_k_HubClient_postgres_resets[] = "HubClient.postgres_resets";
static const char __pyx_k_OR_epoch_coalesce_timeout[] = "OR (epoch < coalesce(timeout, ";
static const char __pyx_k_ThreadSafeSQLiteQueue_get[] = "ThreadSafeSQLiteQueue.get";
static const char __pyx_k_ThreadSafeSQLiteQueue_put[] = "ThreadSafeSQLiteQueue.put";
static const char __pyx_k_HubClient_postgres_cancels[] = "HubClient.postgres_cancels";
static const char __pyx_k_HubClient_postgres_pending[] = "HubClient.postgres_pending";
static const char __pyx_k_HubServer__execute_request[] = "HubServer._execute_request";
static const char __pyx_k_HubServer__process_request[] = "HubServer._process_request";
static const char __pyx_k_HubServer_execute_db_query[] = "HubServer.execute_db_query";
static const char __pyx_k_SELECT_FROM_steps_WHERE_id[] = "SELECT * FROM steps WHERE id = '";
static const char __pyx_k_buelon_core_step_Step_None[] = "buelon.core.step.Step | None";
static const char __pyx_k_buelon_helpers_json_parser[] = "buelon.helpers.json_parser";
static const char __pyx_k_drop_table_bue_session_ids[] = "drop table bue_session_ids;";
static const char __pyx_k_is_already_in_use_Retrying[] = " is already in use. Retrying...";
static const char __pyx_k_list_buelon_core_step_Step[] = "list[buelon.core.step.Step]";
static const char __pyx_k_submit_pipe_code_from_file[] = "submit_pipe_code_from_file";
static const char __pyx_k_upload_pipe_code_from_file[] = "upload_pipe_code_from_file";
static const char __pyx_k_HubClient_postgres_get_rows[] = "HubClient.postgres_get_rows";
static const char __pyx_k_HubClient_postgres_pendings[] = "HubClient.postgres_pendings";
static const char __pyx_k_ThreadSafeSQLiteQueue_qsize[] = "ThreadSafeSQLiteQueue.qsize";
static const char __pyx_k_buelon_core_step_StepStatus[] = "buelon.core.step.StepStatus";
static const char __pyx_k_fetch_errors_locals_genexpr[] = "_fetch_errors.<locals>.genexpr";
static const char __pyx_k_timeout_func_locals_handler[] = "timeout_func.<locals>.handler";
static const char __pyx_k_Error_processing_transaction[] = "Error processing transaction: ";
static const char __pyx_k_HubClient_postgres_get_steps[] = "HubClient.postgres_get_steps";
static const char __pyx_k_LENGTH_OF_PIPELINE_END_TOKEN[] = "LENGTH_OF_PIPELINE_END_TOKEN";
static const char __pyx_k_ThreadSafeSQLiteQueue___init[] = "ThreadSafeSQLiteQueue.__init__";
static const char __pyx_k_buelon_core_pipe_interpreter[] = "buelon.core.pipe_interpreter";
static const char __pyx_k_check_to_delete_bucket_files[] = "_check_to_delete_bucket_files";
static const char __pyx_k_trace_state_waiting_WHERE_id[] = "$trace$, state='waiting' WHERE id = '";
static const char __pyx_k_SELECT_tag_velocity_FROM_tags[] = "SELECT tag, velocity FROM tags";
static const char __pyx_k_UPDATE_buelon_jobs_SET_status[] = "UPDATE buelon_jobs SET status = '";
static const char __pyx_k_update_buelon_jobs_set_status[] = "\n            update buelon_jobs\n            set status = '";
static const char __pyx_k_HubClient_postgres_upload_step[] = "HubClient.postgres_upload_step";
static const char __pyx_k_HubServer__execute_transaction[] = "HubServer._execute_transaction";
static const char __pyx_k_UPDATE_buelon_jobs_s_SET_state[] = "\n                UPDATE buelon_jobs s\n                SET state = 'active'\n                WHERE s.id IN (\n                    SELECT s.id\n                    FROM buelon_jobs s\n                    WHERE ";
static const char __pyx_k_WHERE_s_id_IN_SELECT_s_id_FROM[] = "\n            WHERE s.id IN (\n                SELECT s.id\n                FROM buelon_jobs_active s\n                WHERE ";
static const char __pyx_k_buelon_helpers_lazy_load_class[] = "buelon.helpers.lazy_load_class";
static const char __pyx_k_check_to_delete_bucket_files_2[] = "check_to_delete_bucket_files";
static const char __pyx_k_CREATE_TABLE_IF_NOT_EXISTS_tags[] = "CREATE TABLE IF NOT EXISTS tags (tag, velocity);";
static const char __pyx_k_FOR_UPDATE_SKIP_LOCKED_RETURNIN[] = "\n                FOR UPDATE SKIP LOCKED\n            )\n            RETURNING *\n        )\n        SELECT * FROM updated_jobs;\n        ";
static const char __pyx_k_Fetching_data_for_jobs_by_1_000[] = "Fetching data for jobs by 1,000's";
static const char __pyx_k_HubClient_postgres_delete_steps[] = "HubClient.postgres_delete_steps";
static const char __pyx_k_HubClient_postgres_dones_locals[] = "HubClient.postgres_dones.<locals>.genexpr";
static const char __pyx_k_HubClient_postgres_fetch_errors[] = "HubClient.postgres_fetch_errors.<locals>.clean_query_string.<locals>.genexpr";
static const char __pyx_k_HubClient_postgres_reset_errors[] = "HubClient.postgres_reset_errors";
static const char __pyx_k_HubClient_postgres_upload_steps[] = "HubClient.postgres_upload_steps";
static const char __pyx_k_HubClient_used_outside_the_main[] = "HubClient used outside the main thread cannot use signal.py to timeout connections.";
static const char __pyx_k_HubServer__process_transactions[] = "HubServer._process_transactions";
static const char __pyx_k_INSERT_INTO_buelon_jobs_waiting[] = "INSERT INTO buelon_jobs_waiting (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace, state) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);";
static const char __pyx_k_Repairing_Steps_Commits_every_1[] = "Repairing Steps (Commits every 1,000 repairs)";
static const char __pyx_k_SELECT_id_msg_trace_FROM_buelon[] = "SELECT id, msg, trace FROM buelon_jobs WHERE status = '";
static const char __pyx_k_SELECT_s_id_s_id_s_priority_s_s[] = "\n        SELECT s.id -- s.id, s.priority, s.scope, s.velocity, s.tag, t.velocity as tag_velocity\n        FROM steps s\n        -- LEFT JOIN tags t ON s.tag = t.tag\n        WHERE s.scope IN (";
static const char __pyx_k_ThreadSafeSQLiteQueue_task_done[] = "ThreadSafeSQLiteQueue.task_done";
static const char __pyx_k_UPDATE_steps_SET_status_epoch_W[] = "\n            UPDATE steps \n            SET status = ?, epoch = ?\n            WHERE id IN (";
static const char __pyx_k_WITH_updated_jobs_AS_UPDATE_bue[] = "\n        WITH updated_jobs AS (\n            UPDATE buelon_jobs_active s\n            SET status = '";
static const char __pyx_k_abcdefghijklmnopqrstuvwxyzABCDE[] = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:\"|,.<>/?~`|";
static const char __pyx_k_buj_left_join_buelon_status_map[] = "\t \n) buj\nleft join buelon_status_map bsm\non bsm.value::text = buj.status\n";
static const char __pyx_k_create_table_bue_session_ids_id[] = "create table bue_session_ids (id text primary key, attempts int);";
static const char __pyx_k_fetch_errors_locals_clean_query[] = "_fetch_errors.<locals>.clean_query_string.<locals>.genexpr";
static const char __pyx_k_get_job_statuses_locals_genexpr[] = "get_job_statuses.<locals>.genexpr";
static const char __pyx_k_select_buj_id_bsm_name_from_sel[] = "\nselect buj.id, bsm.name\nfrom (\n\tselect * from buelon_jobs\n\twhere id in ";
static const char __pyx_k_select_max_priority_as_priority[] = "select max(priority) as priority from buelon_jobs_waiting;";
static const char __pyx_k_select_status_count_as_amount_f[] = "\n    select \n        status,\n        count(*) as amount\n    from \n        steps\n    ";
static const char __pyx_k_str_list_str_tuple_str_list_str[] = "str | list[str] | tuple[str | list[str] | None, list[str]] | None";
static const char __pyx_k_upload_pipe_code_locals_genexpr[] = "upload_pipe_code.<locals>.genexpr";
static const char __pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s[] = "CREATE INDEX IF NOT EXISTS idx_steps_status ON steps (status);";
static const char __pyx_k_CREATE_INDEX_if_not_exists_idx_b[] = "CREATE INDEX if not exists idx_buelon_jobs_active_scope_status_priority_epoch ON buelon_jobs (scope, status, priority, epoch);";
static const char __pyx_k_CREATE_TABLE_IF_NOT_EXISTS_buelo[] = "CREATE TABLE IF NOT EXISTS \"buelon_jobs_waiting\" PARTITION OF \"buelon_jobs\" FOR VALUES IN ('waiting');";
static const char __pyx_k_CREATE_TABLE_IF_NOT_EXISTS_steps[] = "CREATE TABLE IF NOT EXISTS steps (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace);";
static const char __pyx_k_CREATE_UNIQUE_INDEX_IF_NOT_EXIST[] = "CREATE UNIQUE INDEX IF NOT EXISTS idx_steps_id ON steps (id);";
static const char __pyx_k_Fetching_parents_of_jobs_by_1_00[] = "Fetching parents of jobs by 1,000's";
static const char __pyx_k_Fetching_queued_not_finished_job[] = "Fetching queued (not finished) jobs";
static const char __pyx_k_HubClient_postgres_cancels_local[] = "HubClient.postgres_cancels.<locals>.genexpr";
static const char __pyx_k_HubClient_postgres_done_locals_g[] = "HubClient.postgres_done.<locals>.genexpr";
static const char __pyx_k_HubClient_postgres_get_step_coun[] = "HubClient.postgres_get_step_count";
static const char __pyx_k_HubClient_postgres_get_steps_loc[] = "HubClient.postgres_get_steps.<locals>.genexpr";
static const char __pyx_k_HubClient_postgres_pendings_loca[] = "HubClient.postgres_pendings.<locals>.genexpr";
static const char __pyx_k_HubClient_postgres_repair_locals[] = "HubClient.postgres_repair.<locals>.should_finish.<locals>.genexpr";
static const char __pyx_k_HubClient_postgres_resets_locals[] = "HubClient.postgres_resets.<locals>.genexpr";
static const char __pyx_k_HubClient_repair_is_only_impleme[] = "HubClient.repair() is only implemented for postgres";
static const char __pyx_k_HubServer__process_request_local[] = "HubServer._process_request.<locals>.genexpr";
static const char __pyx_k_HubServer_execute_db_query_local[] = "HubServer.execute_db_query.<locals>.db_operation";
static const char __pyx_k_HubServer_get_steps_locals_genex[] = "HubServer.get_steps.<locals>.genexpr";
static const char __pyx_k_INSERT_INTO_steps_id_priority_sc[] = "INSERT INTO steps (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
static const char __pyx_k_Insufficient_privileges_to_creat[] = "Insufficient privileges to create table.";
static const char __pyx_k_SELECT_COUNT_FROM_buelon_jobs_WH[] = "SELECT COUNT(*)  FROM buelon_jobs WHERE status = '";
static const char __pyx_k_SELECT_COUNT_FROM_steps_WHERE_st[] = "SELECT COUNT(*) FROM steps WHERE status = '";
static const char __pyx_k_SELECT_FROM_buelon_jobs_WHERE_id[] = "SELECT * FROM buelon_jobs WHERE id = '";
static const char __pyx_k_SELECT_id_msg_trace_FROM_steps_W[] = "SELECT id, msg, trace FROM steps WHERE status = '";
static const char __pyx_k_SELECT_id_priority_scope_velocit[] = "SELECT id, priority, scope, velocity, tag FROM steps WHERE scope IN (";
static const char __pyx_k_SELECT_status_FROM_steps_WHERE_i[] = "SELECT status FROM steps WHERE id IN (";
static const char __pyx_k_TAB_scope_scope_priority_priorit[] = "TAB = '  '\n!scope {scope}\n!priority {priority}\n\njob:\n  python\n  main\n  `\nimport buelon as pete\ndef main(*args):\n    bucket = pete.bucket.Client()\n    code = bucket.get('{key}').decode()\n    pete.hub.upload_pipe_code(code)\n`\n\npipe = | job\npipe()\n";
static const char __pyx_k_ThreadSafeSQLiteQueue__get_queue[] = "ThreadSafeSQLiteQueue._get_queue";
static const char __pyx_k_create_index_if_not_exists_idx_b[] = "create index if not exists idx_buelon_jobs_scope on buelon_jobs using hash (scope);";
static const char __pyx_k_create_table_if_not_exists_buelo[] = "create table if not exists buelon_jobs (\n            id text,\n            priority int,\n            scope text,\n            timeout real,\n            retries int,\n            velocity real,\n            tag text,\n            status text,\n            epoch real,\n            msg text,\n            trace text,\n            state text,\n            unique(id, state)\n        )\n        PARTITION BY LIST (state);";
static const char __pyx_k_delete_from_bue_session_ids_wher[] = "delete from bue_session_ids where id = '";
static const char __pyx_k_dict_str_buelon_core_step_Step_N[] = "dict[str, buelon.core.step.Step | None]";
static const char __pyx_k_drop_table_if_exists_bue_session[] = "drop table if exists bue_session_ids;";
static const char __pyx_k_exclude_must_be_a_list_of_string[] = "exclude must be a list of strings";
static const char __pyx_k_exclude_must_be_a_string_or_a_li[] = "exclude must be a string or a list";
static const char __pyx_k_insert_into_bue_session_ids_id_a[] = "insert into bue_session_ids (id, attempts) values ('";
static const char __pyx_k_select_count_as_amount_min_prior[] = "select count(*) as amount, min(priority) as priority from buelon_jobs_active where status != '";
static const char __pyx_k_select_from_buelon_jobs_where_st[] = "select * from buelon_jobs where status ='2'";
static const char __pyx_k_select_id_attempts_from_bue_sess[] = "select id, attempts from bue_session_ids limit 10;";
static const char __pyx_k_select_id_status_from_buelon_job[] = "select id, status from buelon_jobs where id in (";
static const char __pyx_k_signal_only_works_in_main_thread[] = "signal only works in main thread of the main interpreter";
static const char __pyx_k_timeout_func_locals_CustomTimeou[] = "timeout_func.<locals>.CustomTimeoutError";
static const char __pyx_k_update_bue_session_ids_set_attem[] = "update bue_session_ids set attempts = attempts + 1 where id = '";
static const char __pyx_k_CREATE_TABLE_IF_NOT_EXISTS_tags_2[] = "CREATE TABLE IF NOT EXISTS tags (tag text primary key, velocity real);";
static const char __pyx_k_HubClient_postgres_fetch_errors_2[] = "HubClient.postgres_fetch_errors.<locals>.genexpr";
static const char __pyx_k_HubClient_postgres_fetch_errors_3[] = "HubClient.postgres_fetch_errors.<locals>.clean_query_string";
static const char __pyx_k_HubClient_postgres_fetch_errors_4[] = "HubClient.postgres_fetch_errors";
static const char __pyx_k_fetch_errors_locals_clean_query_2[] = "_fetch_errors.<locals>.clean_query_string";
static const char __pyx_k_select_status_count_as_amount_f_2[] = "\n        select \n            status,\n            count(*) as amount\n        from \n            buelon_jobs\n        ";
static const char __pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_2[] = "CREATE INDEX IF NOT EXISTS idx_steps_priority ON steps (priority);";
static const char __pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_3[] = "CREATE INDEX IF NOT EXISTS idx_steps_scope ON steps (scope);";
static const char __pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_4[] = "CREATE INDEX IF NOT EXISTS idx_steps_epoch ON steps (epoch);";
static const char __pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_5[] = "CREATE INDEX IF NOT EXISTS idx_steps_tag ON steps (tag);";
static const char __pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_6[] = "CREATE INDEX IF NOT EXISTS idx_steps_velocity ON steps (velocity);";
static const char __pyx_k_CREATE_TABLE_IF_NOT_EXISTS_buelo_2[] = "CREATE TABLE IF NOT EXISTS \"buelon_jobs_active\" PARTITION OF \"buelon_jobs\" FOR VALUES IN ('active');";
static const char __pyx_k_CREATE_TABLE_IF_NOT_EXISTS_buelo_3[] = "CREATE TABLE IF NOT EXISTS \"buelon_jobs_archived\" PARTITION OF \"buelon_jobs\" FOR VALUES IN ('archived');";
static const char __pyx_k_HubClient_postgres_get_steps_loc_2[] = "HubClient.postgres_get_steps.<locals>.check_active_state";
static const char __pyx_k_HubClient_postgres_repair_locals_2[] = "HubClient.postgres_repair.<locals>.get_statuses";
static const char __pyx_k_HubClient_postgres_repair_locals_3[] = "HubClient.postgres_repair.<locals>.should_finish";
static const char __pyx_k_create_index_if_not_exists_idx_b_2[] = "create index if not exists idx_buelon_jobs_status on buelon_jobs using hash (status);";
static const char __pyx_k_create_index_if_not_exists_idx_b_3[] = "create index if not exists idx_buelon_jobs_priority on buelon_jobs (priority);";
static const char __pyx_k_create_index_if_not_exists_idx_b_4[] = "create index if not exists idx_buelon_jobs_epoch on buelon_jobs (epoch);";
/* #### Code section: decls ### */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_delete_last_line(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_12timeout_func_handler(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_signum, CYTHON_UNUSED PyObject *__pyx_v_frame); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_2timeout_func(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_timeout_duration, PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_4receive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_conn); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_6send(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_conn, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_8load_db(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_10delete_steps(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_12_delete_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_14reset_errors(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_include_workers); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_16_reset_errors(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_include_workers); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_18get_step_count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_types); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_20_get_step_count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_types); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_22upload_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v__step, PyObject *__pyx_v_status); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_24_upload_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_json, PyObject *__pyx_v_status_value); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_26_upload_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_jsons, PyObject *__pyx_v_status_values); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_16upload_pipe_code_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_28upload_pipe_code(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code, CYTHON_UNUSED PyObject *__pyx_v_lazy_steps, PyObject *__pyx_v_wait_until_finish, PyObject *__pyx_v_return_job_ids, PyObject *__pyx_v_return_job_def_id, PyObject *__pyx_v_job_handler); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_30upload_pipe_code_from_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_lazy_steps, PyObject *__pyx_v_wait_until_finish); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_32submit_pipe_code_from_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_scope); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_84__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_34submit_pipe_code(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code, PyObject *__pyx_v_scope, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_36get_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_38bulk_get_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_step_ids); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_40set_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v__step); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_42set_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_steps); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_44remove_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_46get_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_48bulk_get_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_step_ids); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_50set_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_52bulk_set_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bulk); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_54remove_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_56check_to_delete_bucket_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_already, PyObject *__pyx_v_steps); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_58_check_to_delete_bucket_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_already, PyObject *__pyx_v_steps); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_60_done(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_62_pending(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_64_cancel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_already); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_66_reset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_already); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_68_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_msg, PyObject *__pyx_v_trace); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_18clean_query_string_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_clean_query_string(PyObject *__pyx_self, PyObject *__pyx_v_query_string); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_2genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_5genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_70_fetch_errors(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_count, PyObject *__pyx_v_exclude); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_16get_job_statuses_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_72get_job_statuses(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_job_ids); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_74get_step_status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_86__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_76get_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_scopes, PyObject *__pyx_v_limit, PyObject *__pyx_v_chunk_size, PyObject *__pyx_v_status, PyObject *__pyx_v_include_working, PyObject *__pyx_v_reverse); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_78reset_tag_usage(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_80decrement_tag_usage(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_auto_commit); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_2_get_queue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_4put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_6get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_8task_done(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_10qsize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_2create_db_pool(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_max_connections); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_16execute_db_query_db_operation(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_4execute_db_query(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_params, PyObject *__pyx_v_json_table); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_6start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_8_handle_client(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client_socket); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_10_process_transactions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_12_execute_transaction(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_14_execute_request(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_payload); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_16_process_request_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_16_process_request(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_payload); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_88__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_9get_steps_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_9get_steps_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_18get_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_scopes, PyObject *__pyx_v_limit, CYTHON_UNUSED PyObject *__pyx_v_chunk_size, PyObject *__pyx_v_status, PyObject *__pyx_v_include_working, PyObject *__pyx_v_reverse); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_max_reconnect_attempts); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_2__enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_4__exit__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__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_6buelon_6cython_5c_hub_9HubClient_6connect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_8close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_90__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_10send_request(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_data, PyObject *__pyx_v_timeout, PyObject *__pyx_v_increments, PyObject *__pyx_v_attempts); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_12get_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_scopes, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_14get_rows(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_16done(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_18dones(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_20pending(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_22pendings(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_24cancel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_26cancels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_28reset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_30resets(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_32error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_msg, PyObject *__pyx_v_trace); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_34upload_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_json, PyObject *__pyx_v_status_value); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_36upload_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_jsons, PyObject *__pyx_v_status_values); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_38get_step_count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_types); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_40reset_errors(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_include_workers); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_42delete_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_44fetch_errors(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_count, PyObject *__pyx_v_exclude); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_46repair(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_48load_pg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_92__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_check_active_state(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_min_table_size, PyObject *__pyx_v_scope_section, PyObject *__pyx_v_working_clause, PyObject *__pyx_v_order_by); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_2genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_50postgres_get_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_scopes, PyObject *__pyx_v_limit, CYTHON_UNUSED PyObject *__pyx_v_chunk_size, CYTHON_UNUSED PyObject *__pyx_v_status, PyObject *__pyx_v_include_working, PyObject *__pyx_v_reverse, PyObject *__pyx_v_min_table_size); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_52postgres_get_rows(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_13postgres_done_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_54postgres_done(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_56postgres_dones(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_58postgres_pending(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_17postgres_pendings_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_60postgres_pendings(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_62postgres_cancel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v__HubClient__already); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_16postgres_cancels_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_64postgres_cancels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps, PyObject *__pyx_v__HubClient__already); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_66postgres_reset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v__HubClient__already); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_68postgres_resets(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps, PyObject *__pyx_v__HubClient__already); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_70postgres_error(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_msg, PyObject *__pyx_v_trace); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_72postgres_upload_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_json, PyObject *__pyx_v_status_value); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_74postgres_upload_steps(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_step_jsons, PyObject *__pyx_v_status_values); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_76postgres_get_step_count(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_types); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_78postgres_reset_errors(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_include_workers); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_80postgres_delete_steps(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_18clean_query_string_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_clean_query_string(PyObject *__pyx_self, PyObject *__pyx_v_query_string); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_2genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_5genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_82postgres_fetch_errors(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_count, PyObject *__pyx_v_exclude); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_get_statuses(PyObject *__pyx_self, PyObject *__pyx_v_ids); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_13should_finish_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_2should_finish(PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_84postgres_repair(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_86__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_6buelon_6cython_5c_hub_82main(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_clear = {0, 0, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyString_Type_encode = {0, 0, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyString_Type_split = {0, 0, 0, 0, 0};
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  #ifdef __Pyx_CyFunction_USED
  PyTypeObject *__pyx_CyFunctionType;
  #endif
  #ifdef __Pyx_FusedFunction_USED
  PyTypeObject *__pyx_FusedFunctionType;
  #endif
  #ifdef __Pyx_Generator_USED
  PyTypeObject *__pyx_GeneratorType;
  #endif
  #ifdef __Pyx_IterableCoroutine_USED
  PyTypeObject *__pyx_IterableCoroutineType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineAwaitType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineType;
  #endif
  #if CYTHON_USE_MODULE_STATE
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair;
  PyObject *__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr;
  #endif
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair;
  PyTypeObject *__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr;
  PyObject *__pyx_kp_u_0;
  PyObject *__pyx_kp_s_0_0_0_0;
  PyObject *__pyx_n_s_AF_INET;
  PyObject *__pyx_kp_s_AND_not;
  PyObject *__pyx_kp_u_AND_not_lower_msg_like;
  PyObject *__pyx_kp_u_AND_s_status;
  PyObject *__pyx_kp_u_AND_s_status_2;
  PyObject *__pyx_kp_u_AND_s_status_3;
  PyObject *__pyx_kp_u_AND_status;
  PyObject *__pyx_kp_u_AND_status_2;
  PyObject *__pyx_n_s_Any;
  PyObject *__pyx_n_s_AttributeError;
  PyObject *__pyx_n_s_CANCEL;
  PyObject *__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s;
  PyObject *__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_2;
  PyObject *__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_3;
  PyObject *__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_4;
  PyObject *__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_5;
  PyObject *__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_6;
  PyObject *__pyx_kp_s_CREATE_INDEX_if_not_exists_idx_b;
  PyObject *__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo;
  PyObject *__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_2;
  PyObject *__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_3;
  PyObject *__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_steps;
  PyObject *__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags;
  PyObject *__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags_2;
  PyObject *__pyx_kp_s_CREATE_UNIQUE_INDEX_IF_NOT_EXIST;
  PyObject *__pyx_n_s_Callable;
  PyObject *__pyx_n_s_Client;
  PyObject *__pyx_n_s_ConnectionRefusedError;
  PyObject *__pyx_n_s_CustomTimeoutError;
  PyObject *__pyx_n_s_DEFAULT_SCOPES;
  PyObject *__pyx_n_s_DELETE_STEPS;
  PyObject *__pyx_n_s_DONE;
  PyObject *__pyx_n_s_Done;
  PyObject *__pyx_n_s_ERROR;
  PyObject *__pyx_n_s_Enum;
  PyObject *__pyx_kp_s_Error;
  PyObject *__pyx_kp_u_Error_processing_transaction;
  PyObject *__pyx_kp_s_F;
  PyObject *__pyx_n_s_FETCH_ERRORS;
  PyObject *__pyx_n_s_FETCH_ROWS;
  PyObject *__pyx_kp_u_FOR_UPDATE_SKIP_LOCKED;
  PyObject *__pyx_kp_u_FOR_UPDATE_SKIP_LOCKED_RETURNIN;
  PyObject *__pyx_kp_s_Fetching_data_for_jobs_by_1_000;
  PyObject *__pyx_kp_s_Fetching_parents_of_jobs_by_1_00;
  PyObject *__pyx_kp_s_Fetching_queued_not_finished_job;
  PyObject *__pyx_n_s_GET_STEPS;
  PyObject *__pyx_n_s_HubClient;
  PyObject *__pyx_n_s_HubClient___enter;
  PyObject *__pyx_n_s_HubClient___exit;
  PyObject *__pyx_n_s_HubClient___getattr;
  PyObject *__pyx_n_s_HubClient___init;
  PyObject *__pyx_n_s_HubClient__already;
  PyObject *__pyx_n_s_HubClient_cancel;
  PyObject *__pyx_n_s_HubClient_cancels;
  PyObject *__pyx_n_s_HubClient_close;
  PyObject *__pyx_n_s_HubClient_connect;
  PyObject *__pyx_n_s_HubClient_delete_steps;
  PyObject *__pyx_n_s_HubClient_done;
  PyObject *__pyx_n_s_HubClient_dones;
  PyObject *__pyx_n_s_HubClient_error;
  PyObject *__pyx_n_s_HubClient_fetch_errors;
  PyObject *__pyx_n_s_HubClient_get_rows;
  PyObject *__pyx_n_s_HubClient_get_step_count;
  PyObject *__pyx_n_s_HubClient_get_steps;
  PyObject *__pyx_n_s_HubClient_load_pg;
  PyObject *__pyx_n_s_HubClient_pending;
  PyObject *__pyx_n_s_HubClient_pendings;
  PyObject *__pyx_n_s_HubClient_postgres_cancel;
  PyObject *__pyx_n_s_HubClient_postgres_cancels;
  PyObject *__pyx_n_s_HubClient_postgres_cancels_local;
  PyObject *__pyx_n_s_HubClient_postgres_delete_steps;
  PyObject *__pyx_n_s_HubClient_postgres_done;
  PyObject *__pyx_n_s_HubClient_postgres_done_locals_g;
  PyObject *__pyx_n_s_HubClient_postgres_dones;
  PyObject *__pyx_n_s_HubClient_postgres_dones_locals;
  PyObject *__pyx_n_s_HubClient_postgres_error;
  PyObject *__pyx_n_s_HubClient_postgres_fetch_errors;
  PyObject *__pyx_n_s_HubClient_postgres_fetch_errors_2;
  PyObject *__pyx_n_s_HubClient_postgres_fetch_errors_3;
  PyObject *__pyx_n_s_HubClient_postgres_fetch_errors_4;
  PyObject *__pyx_n_s_HubClient_postgres_get_rows;
  PyObject *__pyx_n_s_HubClient_postgres_get_step_coun;
  PyObject *__pyx_n_s_HubClient_postgres_get_steps;
  PyObject *__pyx_n_s_HubClient_postgres_get_steps_loc;
  PyObject *__pyx_n_s_HubClient_postgres_get_steps_loc_2;
  PyObject *__pyx_n_s_HubClient_postgres_pending;
  PyObject *__pyx_n_s_HubClient_postgres_pendings;
  PyObject *__pyx_n_s_HubClient_postgres_pendings_loca;
  PyObject *__pyx_n_s_HubClient_postgres_repair;
  PyObject *__pyx_n_s_HubClient_postgres_repair_locals;
  PyObject *__pyx_n_s_HubClient_postgres_repair_locals_2;
  PyObject *__pyx_n_s_HubClient_postgres_repair_locals_3;
  PyObject *__pyx_n_s_HubClient_postgres_reset;
  PyObject *__pyx_n_s_HubClient_postgres_reset_errors;
  PyObject *__pyx_n_s_HubClient_postgres_resets;
  PyObject *__pyx_n_s_HubClient_postgres_resets_locals;
  PyObject *__pyx_n_s_HubClient_postgres_upload_step;
  PyObject *__pyx_n_s_HubClient_postgres_upload_steps;
  PyObject *__pyx_n_s_HubClient_repair;
  PyObject *__pyx_kp_s_HubClient_repair_is_only_impleme;
  PyObject *__pyx_n_s_HubClient_reset;
  PyObject *__pyx_n_s_HubClient_reset_errors;
  PyObject *__pyx_n_s_HubClient_resets;
  PyObject *__pyx_n_s_HubClient_send_request;
  PyObject *__pyx_n_s_HubClient_upload_step;
  PyObject *__pyx_n_s_HubClient_upload_steps;
  PyObject *__pyx_kp_s_HubClient_used_outside_the_main;
  PyObject *__pyx_n_s_HubServer;
  PyObject *__pyx_n_s_HubServer___init;
  PyObject *__pyx_n_s_HubServer__execute_request;
  PyObject *__pyx_n_s_HubServer__execute_transaction;
  PyObject *__pyx_n_s_HubServer__handle_client;
  PyObject *__pyx_n_s_HubServer__process_request;
  PyObject *__pyx_n_s_HubServer__process_request_local;
  PyObject *__pyx_n_s_HubServer__process_transactions;
  PyObject *__pyx_n_s_HubServer_create_db_pool;
  PyObject *__pyx_n_s_HubServer_execute_db_query;
  PyObject *__pyx_n_s_HubServer_execute_db_query_local;
  PyObject *__pyx_n_s_HubServer_get_steps;
  PyObject *__pyx_n_s_HubServer_get_steps_locals_genex;
  PyObject *__pyx_n_s_HubServer_start;
  PyObject *__pyx_kp_s_INSERT_INTO_buelon_jobs_waiting;
  PyObject *__pyx_kp_s_INSERT_INTO_steps_id_priority_sc;
  PyObject *__pyx_n_s_IPPROTO_TCP;
  PyObject *__pyx_n_s_InsufficientPrivilege;
  PyObject *__pyx_kp_s_Insufficient_privileges_to_creat;
  PyObject *__pyx_kp_u_Invalid_method;
  PyObject *__pyx_kp_u_Invalid_value_received;
  PyObject *__pyx_kp_s_K;
  PyObject *__pyx_n_s_KeyboardInterrupt;
  PyObject *__pyx_n_s_LENGTH_OF_PIPELINE_END_TOKEN;
  PyObject *__pyx_kp_u_LIMIT;
  PyObject *__pyx_kp_u_LIMIT_2;
  PyObject *__pyx_kp_u_LIMIT_3;
  PyObject *__pyx_kp_u_LIMIT_4;
  PyObject *__pyx_kp_u_LIMIT_5;
  PyObject *__pyx_kp_u_LIMIT_OFFSET;
  PyObject *__pyx_n_s_Lock;
  PyObject *__pyx_kp_s_Max_errors_met;
  PyObject *__pyx_n_s_Method;
  PyObject *__pyx_n_s_ModuleNotFoundError;
  PyObject *__pyx_kp_u_No_data_found_for_step;
  PyObject *__pyx_n_s_None;
  PyObject *__pyx_kp_u_None;
  PyObject *__pyx_kp_s_OR;
  PyObject *__pyx_kp_u_ORDER_BY;
  PyObject *__pyx_kp_u_ORDER_BY_2;
  PyObject *__pyx_kp_u_ORDER_BY_3;
  PyObject *__pyx_kp_u_ORDER_BY_4;
  PyObject *__pyx_kp_u_OR_epoch_coalesce_timeout;
  PyObject *__pyx_kp_u_OR_lower_trace_like;
  PyObject *__pyx_n_s_OSError;
  PyObject *__pyx_n_s_PENDING;
  PyObject *__pyx_n_s_PIPELINE_END_TOKEN;
  PyObject *__pyx_n_s_PIPELINE_HOST;
  PyObject *__pyx_n_s_PIPELINE_PORT;
  PyObject *__pyx_n_s_PIPELINE_SPLIT_TOKEN;
  PyObject *__pyx_n_s_PIPE_WORKER_HOST;
  PyObject *__pyx_n_s_PIPE_WORKER_PORT;
  PyObject *__pyx_kp_s_PRAGMA_journal_mode_WAL;
  PyObject *__pyx_kp_u_Port;
  PyObject *__pyx_n_s_Queue;
  PyObject *__pyx_n_s_RESET;
  PyObject *__pyx_n_s_RESET_ERRORS;
  PyObject *__pyx_kp_s_Repairing_Steps_Commits_every_1;
  PyObject *__pyx_kp_u_Request_timed_out_after;
  PyObject *__pyx_kp_u_SELECT_COUNT_FROM_buelon_jobs_WH;
  PyObject *__pyx_kp_u_SELECT_COUNT_FROM_steps_WHERE_st;
  PyObject *__pyx_kp_u_SELECT_FROM_buelon_jobs_WHERE_id;
  PyObject *__pyx_kp_u_SELECT_FROM_steps_WHERE_id;
  PyObject *__pyx_kp_u_SELECT_id_msg_trace_FROM_buelon;
  PyObject *__pyx_kp_u_SELECT_id_msg_trace_FROM_steps_W;
  PyObject *__pyx_kp_u_SELECT_id_priority_scope_velocit;
  PyObject *__pyx_kp_u_SELECT_s_id_s_id_s_priority_s_s;
  PyObject *__pyx_kp_u_SELECT_status_FROM_steps_WHERE_i;
  PyObject *__pyx_kp_s_SELECT_tag_velocity_FROM_tags;
  PyObject *__pyx_n_s_SHUT_RDWR;
  PyObject *__pyx_n_s_SIGALRM;
  PyObject *__pyx_n_s_SOCK_STREAM;
  PyObject *__pyx_n_s_SQLiteQueue;
  PyObject *__pyx_n_s_STEP_COUNT;
  PyObject *__pyx_kp_u_Server_listening_on;
  PyObject *__pyx_n_s_Step;
  PyObject *__pyx_n_s_StepStatus;
  PyObject *__pyx_kp_s_TAB_scope_scope_priority_priorit;
  PyObject *__pyx_n_s_TCP_NODELAY;
  PyObject *__pyx_n_s_Thread;
  PyObject *__pyx_n_s_ThreadPoolExecutor;
  PyObject *__pyx_n_s_ThreadSafeSQLiteQueue;
  PyObject *__pyx_n_s_ThreadSafeSQLiteQueue___init;
  PyObject *__pyx_n_s_ThreadSafeSQLiteQueue__get_queue;
  PyObject *__pyx_n_s_ThreadSafeSQLiteQueue_get;
  PyObject *__pyx_n_s_ThreadSafeSQLiteQueue_put;
  PyObject *__pyx_n_s_ThreadSafeSQLiteQueue_qsize;
  PyObject *__pyx_n_s_ThreadSafeSQLiteQueue_task_done;
  PyObject *__pyx_n_s_TimeoutError;
  PyObject *__pyx_kp_u_UPDATE_buelon_jobs_SET_status;
  PyObject *__pyx_kp_u_UPDATE_buelon_jobs_s_SET_state;
  PyObject *__pyx_kp_u_UPDATE_steps_SET_status;
  PyObject *__pyx_kp_u_UPDATE_steps_SET_status_epoch_W;
  PyObject *__pyx_n_s_UPLOAD_STEP;
  PyObject *__pyx_n_s_UPLOAD_STEPS;
  PyObject *__pyx_n_s_USING_POSTGRES;
  PyObject *__pyx_n_s_USING_POSTGRES_HUB;
  PyObject *__pyx_kp_s_Uploading_Jobs;
  PyObject *__pyx_n_s_ValueError;
  PyObject *__pyx_kp_u_WHEN_THEN;
  PyObject *__pyx_kp_u_WHERE_id_IN;
  PyObject *__pyx_kp_u_WHERE_s_id_IN_SELECT_s_id_FROM;
  PyObject *__pyx_kp_u_WITH_updated_jobs_AS_UPDATE_bue;
  PyObject *__pyx_n_s_WORKER_HOST;
  PyObject *__pyx_n_s_WORKER_PORT;
  PyObject *__pyx_n_s_Windows;
  PyObject *__pyx_kp_s__10;
  PyObject *__pyx_kp_u__10;
  PyObject *__pyx_kp_s__11;
  PyObject *__pyx_kp_u__12;
  PyObject *__pyx_kp_u__13;
  PyObject *__pyx_kp_s__14;
  PyObject *__pyx_kp_u__14;
  PyObject *__pyx_kp_s__15;
  PyObject *__pyx_kp_u__16;
  PyObject *__pyx_kp_s__20;
  PyObject *__pyx_kp_s__21;
  PyObject *__pyx_kp_s__22;
  PyObject *__pyx_kp_s__23;
  PyObject *__pyx_kp_u__23;
  PyObject *__pyx_kp_u__24;
  PyObject *__pyx_kp_b__3;
  PyObject *__pyx_kp_s__3;
  PyObject *__pyx_kp_u__30;
  PyObject *__pyx_kp_u__31;
  PyObject *__pyx_kp_s__32;
  PyObject *__pyx_kp_s__33;
  PyObject *__pyx_kp_u__34;
  PyObject *__pyx_kp_u__35;
  PyObject *__pyx_kp_u__39;
  PyObject *__pyx_kp_u__4;
  PyObject *__pyx_kp_u__42;
  PyObject *__pyx_kp_u__44;
  PyObject *__pyx_kp_u__45;
  PyObject *__pyx_kp_u__48;
  PyObject *__pyx_kp_u__49;
  PyObject *__pyx_kp_u__50;
  PyObject *__pyx_kp_b__68;
  PyObject *__pyx_kp_b__69;
  PyObject *__pyx_kp_u__8;
  PyObject *__pyx_kp_u__9;
  PyObject *__pyx_kp_s_abcdefghijklmnopqrstuvwxyzABCDE;
  PyObject *__pyx_n_s_accept;
  PyObject *__pyx_n_s_active;
  PyObject *__pyx_n_s_add;
  PyObject *__pyx_n_s_addr;
  PyObject *__pyx_n_s_alarm;
  PyObject *__pyx_n_s_all;
  PyObject *__pyx_n_s_allow_chars;
  PyObject *__pyx_n_s_already;
  PyObject *__pyx_n_s_already_2;
  PyObject *__pyx_n_s_amount;
  PyObject *__pyx_kp_u_and_status;
  PyObject *__pyx_n_s_append;
  PyObject *__pyx_n_s_args;
  PyObject *__pyx_n_s_asyncio;
  PyObject *__pyx_n_s_asyncio_coroutines;
  PyObject *__pyx_n_s_asyncio_tasks;
  PyObject *__pyx_n_s_attempt;
  PyObject *__pyx_n_s_attempts;
  PyObject *__pyx_n_s_auto_commit;
  PyObject *__pyx_n_s_b;
  PyObject *__pyx_n_s_bind;
  PyObject *__pyx_n_s_bool;
  PyObject *__pyx_n_s_bucket;
  PyObject *__pyx_n_s_bucket_client;
  PyObject *__pyx_n_s_buelon;
  PyObject *__pyx_n_s_buelon_bucket;
  PyObject *__pyx_n_s_buelon_core_pipe_debug;
  PyObject *__pyx_n_s_buelon_core_pipe_interpreter;
  PyObject *__pyx_n_s_buelon_core_step;
  PyObject *__pyx_kp_s_buelon_core_step_Step;
  PyObject *__pyx_kp_s_buelon_core_step_StepStatus;
  PyObject *__pyx_kp_s_buelon_core_step_Step_None;
  PyObject *__pyx_n_s_buelon_cython_c_hub;
  PyObject *__pyx_kp_s_buelon_cython_c_hub_pyx;
  PyObject *__pyx_n_s_buelon_helpers_json_parser;
  PyObject *__pyx_n_s_buelon_helpers_lazy_load_class;
  PyObject *__pyx_n_s_buelon_status_map;
  PyObject *__pyx_kp_u_buj_left_join_buelon_status_map;
  PyObject *__pyx_n_s_bulk;
  PyObject *__pyx_n_s_bulk_get;
  PyObject *__pyx_n_s_bulk_get_data;
  PyObject *__pyx_n_s_bulk_get_step;
  PyObject *__pyx_n_s_bulk_set;
  PyObject *__pyx_n_s_bulk_set_data;
  PyObject *__pyx_n_s_bytes;
  PyObject *__pyx_n_s_c;
  PyObject *__pyx_kp_s_callable_None;
  PyObject *__pyx_n_s_cancel;
  PyObject *__pyx_n_s_cancel_2;
  PyObject *__pyx_n_s_cancels;
  PyObject *__pyx_n_s_case_statement;
  PyObject *__pyx_n_s_check_active_state;
  PyObject *__pyx_n_s_check_to_delete_bucket_files;
  PyObject *__pyx_n_s_check_to_delete_bucket_files_2;
  PyObject *__pyx_n_s_child;
  PyObject *__pyx_n_s_children;
  PyObject *__pyx_n_s_children_params;
  PyObject *__pyx_n_s_chunk;
  PyObject *__pyx_n_s_chunk_size;
  PyObject *__pyx_n_s_class_getitem;
  PyObject *__pyx_n_s_clean_query_string;
  PyObject *__pyx_n_s_clear;
  PyObject *__pyx_n_s_client;
  PyObject *__pyx_n_s_client_socket;
  PyObject *__pyx_n_s_client_thread;
  PyObject *__pyx_n_s_cline_in_traceback;
  PyObject *__pyx_n_s_close;
  PyObject *__pyx_n_s_code;
  PyObject *__pyx_n_s_collections;
  PyObject *__pyx_n_s_commit;
  PyObject *__pyx_n_s_concurrent_futures;
  PyObject *__pyx_n_s_config;
  PyObject *__pyx_n_s_conn;
  PyObject *__pyx_n_s_connect;
  PyObject *__pyx_n_s_connection_queue;
  PyObject *__pyx_n_s_core;
  PyObject *__pyx_n_s_count;
  PyObject *__pyx_kp_s_count_must_be_an_integer;
  PyObject *__pyx_n_s_create_db_pool;
  PyObject *__pyx_kp_s_create_index_if_not_exists_idx_b;
  PyObject *__pyx_kp_s_create_index_if_not_exists_idx_b_2;
  PyObject *__pyx_kp_s_create_index_if_not_exists_idx_b_3;
  PyObject *__pyx_kp_s_create_index_if_not_exists_idx_b_4;
  PyObject *__pyx_kp_s_create_table_bue_session_ids_id;
  PyObject *__pyx_kp_s_create_table_if_not_exists_buelo;
  PyObject *__pyx_n_s_cur;
  PyObject *__pyx_n_s_cursor;
  PyObject *__pyx_n_s_d;
  PyObject *__pyx_n_s_daemon;
  PyObject *__pyx_n_s_data;
  PyObject *__pyx_kp_s_database_db;
  PyObject *__pyx_n_s_db;
  PyObject *__pyx_n_s_db_operation;
  PyObject *__pyx_n_s_db_path;
  PyObject *__pyx_n_s_db_pool;
  PyObject *__pyx_n_s_decode;
  PyObject *__pyx_n_s_decrement_tag_usage;
  PyObject *__pyx_n_s_default;
  PyObject *__pyx_n_s_defaultdict;
  PyObject *__pyx_n_s_delete;
  PyObject *__pyx_kp_u_delete_from_bue_session_ids_wher;
  PyObject *__pyx_kp_s_delete_from_buelon_jobs;
  PyObject *__pyx_kp_s_delete_from_steps;
  PyObject *__pyx_n_s_delete_last_line;
  PyObject *__pyx_kp_b_delete_steps;
  PyObject *__pyx_kp_s_delete_steps;
  PyObject *__pyx_n_s_delete_steps_2;
  PyObject *__pyx_n_s_delete_steps_3;
  PyObject *__pyx_n_s_desc;
  PyObject *__pyx_n_s_description;
  PyObject *__pyx_n_s_dict;
  PyObject *__pyx_n_s_dict_2;
  PyObject *__pyx_kp_s_dict_str_Any;
  PyObject *__pyx_kp_s_dict_str_buelon_core_step_Step_N;
  PyObject *__pyx_kp_u_disable;
  PyObject *__pyx_n_s_doc;
  PyObject *__pyx_n_s_done;
  PyObject *__pyx_n_s_done_2;
  PyObject *__pyx_n_s_dones;
  PyObject *__pyx_n_s_dotenv;
  PyObject *__pyx_n_s_download_table;
  PyObject *__pyx_kp_s_drop_table_bue_session_ids;
  PyObject *__pyx_kp_s_drop_table_if_exists_bue_session;
  PyObject *__pyx_n_s_dumps;
  PyObject *__pyx_n_s_e;
  PyObject *__pyx_kp_u_enable;
  PyObject *__pyx_n_s_encode;
  PyObject *__pyx_n_s_end;
  PyObject *__pyx_n_s_endswith;
  PyObject *__pyx_n_s_enter;
  PyObject *__pyx_n_s_enum;
  PyObject *__pyx_kp_s_env;
  PyObject *__pyx_n_s_environ;
  PyObject *__pyx_kp_u_epoch;
  PyObject *__pyx_kp_u_epoch_WHERE_id;
  PyObject *__pyx_kp_u_epoch_WHERE_id_IN;
  PyObject *__pyx_kp_u_epoch_msg_trace_WHERE_id;
  PyObject *__pyx_n_s_error;
  PyObject *__pyx_n_s_error_2;
  PyObject *__pyx_kp_u_error_3;
  PyObject *__pyx_n_s_error_size;
  PyObject *__pyx_n_s_error_size_query;
  PyObject *__pyx_n_s_errors;
  PyObject *__pyx_n_s_exc;
  PyObject *__pyx_n_s_exc_tb;
  PyObject *__pyx_n_s_exc_type;
  PyObject *__pyx_n_s_exc_val;
  PyObject *__pyx_n_s_exclude;
  PyObject *__pyx_kp_s_exclude_must_be_a_list_of_string;
  PyObject *__pyx_kp_s_exclude_must_be_a_string_or_a_li;
  PyObject *__pyx_n_s_exclude_query;
  PyObject *__pyx_n_s_execute;
  PyObject *__pyx_n_s_execute_batch;
  PyObject *__pyx_n_s_execute_db_query;
  PyObject *__pyx_n_s_execute_request;
  PyObject *__pyx_n_s_execute_transaction;
  PyObject *__pyx_n_s_executing;
  PyObject *__pyx_n_s_execution_queue;
  PyObject *__pyx_n_s_executor_thread;
  PyObject *__pyx_n_s_exit;
  PyObject *__pyx_n_s_exit_2;
  PyObject *__pyx_n_s_expiration_time;
  PyObject *__pyx_n_s_extras;
  PyObject *__pyx_n_s_f;
  PyObject *__pyx_n_s_fail;
  PyObject *__pyx_n_b_false;
  PyObject *__pyx_n_s_false;
  PyObject *__pyx_n_s_fetch_errors;
  PyObject *__pyx_kp_s_fetch_errors_2;
  PyObject *__pyx_n_s_fetch_errors_3;
  PyObject *__pyx_n_s_fetch_errors_locals_clean_query;
  PyObject *__pyx_n_s_fetch_errors_locals_clean_query_2;
  PyObject *__pyx_n_s_fetch_errors_locals_genexpr;
  PyObject *__pyx_kp_s_fetch_rows;
  PyObject *__pyx_n_s_fetchall;
  PyObject *__pyx_n_s_file_path;
  PyObject *__pyx_n_s_finished_statuses;
  PyObject *__pyx_n_s_first_iteration;
  PyObject *__pyx_n_s_format;
  PyObject *__pyx_n_s_frame;
  PyObject *__pyx_n_s_from_json;
  PyObject *__pyx_n_s_func;
  PyObject *__pyx_kp_u_gc;
  PyObject *__pyx_n_s_generate_steps_from_code;
  PyObject *__pyx_n_s_genexpr;
  PyObject *__pyx_n_s_get;
  PyObject *__pyx_n_s_get_data;
  PyObject *__pyx_n_s_get_job_statuses;
  PyObject *__pyx_n_s_get_job_statuses_locals_genexpr;
  PyObject *__pyx_n_s_get_postgres_from_env;
  PyObject *__pyx_n_s_get_queue;
  PyObject *__pyx_n_s_get_rows;
  PyObject *__pyx_n_s_get_statuses;
  PyObject *__pyx_n_s_get_step;
  PyObject *__pyx_n_s_get_step_count;
  PyObject *__pyx_n_s_get_step_count_2;
  PyObject *__pyx_n_s_get_step_status;
  PyObject *__pyx_n_s_get_steps;
  PyObject *__pyx_kp_s_get_steps_2;
  PyObject *__pyx_n_s_getattr;
  PyObject *__pyx_kp_u_group_by_status;
  PyObject *__pyx_kp_u_group_by_status_2;
  PyObject *__pyx_n_s_handle_client;
  PyObject *__pyx_n_s_handler;
  PyObject *__pyx_n_s_headers;
  PyObject *__pyx_n_s_helpers;
  PyObject *__pyx_n_s_host;
  PyObject *__pyx_n_s_hub;
  PyObject *__pyx_n_s_i;
  PyObject *__pyx_n_s_id;
  PyObject *__pyx_kp_u_id_2;
  PyObject *__pyx_kp_u_id_IN;
  PyObject *__pyx_n_s_id_column;
  PyObject *__pyx_kp_s_id_in;
  PyObject *__pyx_n_s_ids;
  PyObject *__pyx_n_s_import;
  PyObject *__pyx_n_s_include_workers;
  PyObject *__pyx_n_s_include_working;
  PyObject *__pyx_n_s_increments;
  PyObject *__pyx_n_s_index;
  PyObject *__pyx_n_s_init;
  PyObject *__pyx_n_s_init_subclass;
  PyObject *__pyx_n_s_initializing;
  PyObject *__pyx_kp_u_insert_into_bue_session_ids_id_a;
  PyObject *__pyx_n_s_inspect;
  PyObject *__pyx_n_s_int;
  PyObject *__pyx_kp_s_int_float;
  PyObject *__pyx_kp_s_int_float_Callable;
  PyObject *__pyx_kp_u_is_already_in_use_Retrying;
  PyObject *__pyx_n_s_is_coroutine;
  PyObject *__pyx_kp_u_isenabled;
  PyObject *__pyx_n_s_item;
  PyObject *__pyx_n_s_items;
  PyObject *__pyx_n_s_job;
  PyObject *__pyx_n_s_job_handler;
  PyObject *__pyx_n_s_job_ids;
  PyObject *__pyx_n_s_join;
  PyObject *__pyx_n_s_json_parser;
  PyObject *__pyx_n_s_json_table;
  PyObject *__pyx_n_s_k;
  PyObject *__pyx_n_s_key;
  PyObject *__pyx_n_s_key_map;
  PyObject *__pyx_n_s_keys;
  PyObject *__pyx_n_s_kwargs;
  PyObject *__pyx_n_s_lazy_load_class;
  PyObject *__pyx_n_s_lazy_steps;
  PyObject *__pyx_n_s_limit;
  PyObject *__pyx_n_s_list;
  PyObject *__pyx_kp_s_list_None;
  PyObject *__pyx_kp_s_list_buelon_core_step_Step;
  PyObject *__pyx_kp_s_list_dict;
  PyObject *__pyx_kp_s_list_str;
  PyObject *__pyx_kp_s_list_str_str_None;
  PyObject *__pyx_n_s_listen;
  PyObject *__pyx_n_s_load_db;
  PyObject *__pyx_n_s_load_dotenv;
  PyObject *__pyx_n_s_load_pg;
  PyObject *__pyx_n_s_loads;
  PyObject *__pyx_n_s_local;
  PyObject *__pyx_n_s_localhost;
  PyObject *__pyx_kp_u_lower_msg_like;
  PyObject *__pyx_n_s_main;
  PyObject *__pyx_n_s_main_2;
  PyObject *__pyx_n_s_max_connections;
  PyObject *__pyx_n_s_max_reconnect_attempts;
  PyObject *__pyx_n_s_max_workers;
  PyObject *__pyx_n_s_metaclass;
  PyObject *__pyx_n_s_method;
  PyObject *__pyx_n_s_min_table_size;
  PyObject *__pyx_n_s_module;
  PyObject *__pyx_n_s_mro_entries;
  PyObject *__pyx_n_s_msg;
  PyObject *__pyx_kp_u_msg_msg;
  PyObject *__pyx_kp_u_msg_trace_trace;
  PyObject *__pyx_n_s_name;
  PyObject *__pyx_n_s_name_2;
  PyObject *__pyx_n_s_new_bulk;
  PyObject *__pyx_n_s_new_key;
  PyObject *__pyx_n_s_new_output;
  PyObject *__pyx_n_b_nothing;
  PyObject *__pyx_n_s_offset;
  PyObject *__pyx_n_b_ok;
  PyObject *__pyx_n_s_open;
  PyObject *__pyx_kp_u_or_epoch;
  PyObject *__pyx_kp_u_or_status;
  PyObject *__pyx_n_s_order_by;
  PyObject *__pyx_n_s_os;
  PyObject *__pyx_n_s_output;
  PyObject *__pyx_n_s_p;
  PyObject *__pyx_n_s_params;
  PyObject *__pyx_n_s_parent;
  PyObject *__pyx_n_s_parent_statuses;
  PyObject *__pyx_n_s_parents;
  PyObject *__pyx_n_s_path;
  PyObject *__pyx_n_s_payload;
  PyObject *__pyx_n_s_pending;
  PyObject *__pyx_n_s_pending_2;
  PyObject *__pyx_n_s_pendings;
  PyObject *__pyx_n_s_persistqueue;
  PyObject *__pyx_n_s_pipe_debug;
  PyObject *__pyx_n_s_pipe_interpreter;
  PyObject *__pyx_n_s_platform;
  PyObject *__pyx_n_s_port;
  PyObject *__pyx_n_s_postgres;
  PyObject *__pyx_n_s_postgres_cancel;
  PyObject *__pyx_n_s_postgres_cancels;
  PyObject *__pyx_n_s_postgres_delete_steps;
  PyObject *__pyx_n_s_postgres_done;
  PyObject *__pyx_n_s_postgres_dones;
  PyObject *__pyx_n_s_postgres_error;
  PyObject *__pyx_n_s_postgres_fetch_errors;
  PyObject *__pyx_n_s_postgres_get_rows;
  PyObject *__pyx_n_s_postgres_get_step_count;
  PyObject *__pyx_n_s_postgres_get_steps;
  PyObject *__pyx_n_s_postgres_pending;
  PyObject *__pyx_n_s_postgres_pendings;
  PyObject *__pyx_n_s_postgres_repair;
  PyObject *__pyx_n_s_postgres_reset;
  PyObject *__pyx_n_s_postgres_reset_errors;
  PyObject *__pyx_n_s_postgres_resets;
  PyObject *__pyx_n_s_postgres_upload_step;
  PyObject *__pyx_n_s_postgres_upload_steps;
  PyObject *__pyx_n_s_prepare;
  PyObject *__pyx_n_s_print;
  PyObject *__pyx_n_s_print_exc;
  PyObject *__pyx_n_s_priority;
  PyObject *__pyx_kp_s_priority_ASC_epoch;
  PyObject *__pyx_kp_s_priority_DESC_epoch;
  PyObject *__pyx_kp_s_priority_asc_epoch;
  PyObject *__pyx_kp_s_priority_desc_epoch;
  PyObject *__pyx_n_s_process_request;
  PyObject *__pyx_n_s_process_transactions;
  PyObject *__pyx_n_s_processing;
  PyObject *__pyx_n_s_psycopg2;
  PyObject *__pyx_n_s_put;
  PyObject *__pyx_n_s_q;
  PyObject *__pyx_n_s_qs;
  PyObject *__pyx_n_s_qsize;
  PyObject *__pyx_n_s_qualname;
  PyObject *__pyx_n_s_query;
  PyObject *__pyx_n_s_query_string;
  PyObject *__pyx_n_s_queue;
  PyObject *__pyx_n_s_queued;
  PyObject *__pyx_n_s_r;
  PyObject *__pyx_n_s_range;
  PyObject *__pyx_n_s_read;
  PyObject *__pyx_n_s_receive;
  PyObject *__pyx_n_s_received;
  PyObject *__pyx_n_s_recv;
  PyObject *__pyx_n_s_remove_data;
  PyObject *__pyx_n_s_remove_step;
  PyObject *__pyx_n_s_repair;
  PyObject *__pyx_n_s_request;
  PyObject *__pyx_n_s_reset;
  PyObject *__pyx_n_s_reset_2;
  PyObject *__pyx_kp_b_reset_errors;
  PyObject *__pyx_kp_s_reset_errors;
  PyObject *__pyx_n_s_reset_errors_2;
  PyObject *__pyx_n_s_reset_errors_3;
  PyObject *__pyx_n_s_reset_tag_usage;
  PyObject *__pyx_n_s_resets;
  PyObject *__pyx_n_s_response;
  PyObject *__pyx_n_s_result;
  PyObject *__pyx_n_s_retries;
  PyObject *__pyx_n_s_return;
  PyObject *__pyx_n_s_return_job_def_id;
  PyObject *__pyx_n_s_return_job_ids;
  PyObject *__pyx_n_s_reverse;
  PyObject *__pyx_n_s_row;
  PyObject *__pyx_n_s_rows;
  PyObject *__pyx_n_s_s;
  PyObject *__pyx_kp_u_s_scope;
  PyObject *__pyx_kp_u_s_scope_ANY_array;
  PyObject *__pyx_n_s_scope;
  PyObject *__pyx_n_s_scope_section;
  PyObject *__pyx_n_s_scopes;
  PyObject *__pyx_kp_u_seconds;
  PyObject *__pyx_kp_u_select_buj_id_bsm_name_from_sel;
  PyObject *__pyx_kp_u_select_count_as_amount_min_prior;
  PyObject *__pyx_kp_s_select_from_buelon_jobs_where_st;
  PyObject *__pyx_kp_s_select_id_attempts_from_bue_sess;
  PyObject *__pyx_kp_u_select_id_status_from_buelon_job;
  PyObject *__pyx_kp_u_select_max_priority_as_priority;
  PyObject *__pyx_kp_u_select_status_count_as_amount_f;
  PyObject *__pyx_kp_u_select_status_count_as_amount_f_2;
  PyObject *__pyx_n_s_self;
  PyObject *__pyx_n_s_send;
  PyObject *__pyx_n_s_send_request;
  PyObject *__pyx_n_s_sendall;
  PyObject *__pyx_n_s_server;
  PyObject *__pyx_n_s_set;
  PyObject *__pyx_kp_s_set_None;
  PyObject *__pyx_n_s_set_data;
  PyObject *__pyx_n_s_set_name;
  PyObject *__pyx_n_s_set_step;
  PyObject *__pyx_n_s_set_steps;
  PyObject *__pyx_n_s_setdefaulttimeout;
  PyObject *__pyx_n_s_setsockopt;
  PyObject *__pyx_n_s_settimeout;
  PyObject *__pyx_n_s_should_finish;
  PyObject *__pyx_n_s_shutdown;
  PyObject *__pyx_n_s_signal;
  PyObject *__pyx_kp_s_signal_only_works_in_main_thread;
  PyObject *__pyx_n_s_signum;
  PyObject *__pyx_n_s_sleep;
  PyObject *__pyx_n_s_socket;
  PyObject *__pyx_kp_s_socket_socket;
  PyObject *__pyx_n_s_spec;
  PyObject *__pyx_n_s_split;
  PyObject *__pyx_n_s_sql;
  PyObject *__pyx_n_s_sql_set_to_working;
  PyObject *__pyx_n_s_sql_update_children;
  PyObject *__pyx_n_s_sql_update_step;
  PyObject *__pyx_n_s_sqlite3;
  PyObject *__pyx_n_s_ss;
  PyObject *__pyx_n_s_start;
  PyObject *__pyx_n_s_state;
  PyObject *__pyx_kp_u_state_archived_WHERE;
  PyObject *__pyx_kp_u_state_archived_WHERE_id;
  PyObject *__pyx_kp_u_state_waiting_WHERE;
  PyObject *__pyx_kp_u_state_waiting_WHERE_id;
  PyObject *__pyx_n_s_status;
  PyObject *__pyx_n_s_status_value;
  PyObject *__pyx_n_s_status_values;
  PyObject *__pyx_n_s_statuses;
  PyObject *__pyx_n_s_stdout;
  PyObject *__pyx_n_s_step;
  PyObject *__pyx_n_s_step_2;
  PyObject *__pyx_kp_u_step_3;
  PyObject *__pyx_kp_b_step_count;
  PyObject *__pyx_kp_s_step_count;
  PyObject *__pyx_kp_u_step_data;
  PyObject *__pyx_n_s_step_id;
  PyObject *__pyx_n_s_step_ids;
  PyObject *__pyx_n_s_step_json;
  PyObject *__pyx_n_s_step_jsons;
  PyObject *__pyx_n_s_steps;
  PyObject *__pyx_n_s_str;
  PyObject *__pyx_kp_s_str_None;
  PyObject *__pyx_kp_s_str_list_str_None;
  PyObject *__pyx_kp_s_str_list_str_tuple_str_list_str;
  PyObject *__pyx_n_s_string;
  PyObject *__pyx_n_s_strip;
  PyObject *__pyx_n_s_submit;
  PyObject *__pyx_kp_u_submit_jobs;
  PyObject *__pyx_n_s_submit_pipe_code;
  PyObject *__pyx_n_s_submit_pipe_code_from_file;
  PyObject *__pyx_n_s_success;
  PyObject *__pyx_n_s_suffix;
  PyObject *__pyx_n_s_super;
  PyObject *__pyx_n_s_sync;
  PyObject *__pyx_n_s_sys;
  PyObject *__pyx_n_s_system;
  PyObject *__pyx_n_s_table;
  PyObject *__pyx_n_s_tag;
  PyObject *__pyx_n_s_tag_lock;
  PyObject *__pyx_n_s_tag_usage;
  PyObject *__pyx_n_s_tag_velocities;
  PyObject *__pyx_n_s_target;
  PyObject *__pyx_n_s_task_done;
  PyObject *__pyx_n_s_test;
  PyObject *__pyx_n_s_thread;
  PyObject *__pyx_n_s_threading;
  PyObject *__pyx_n_s_throw;
  PyObject *__pyx_n_s_time;
  PyObject *__pyx_n_s_timeout;
  PyObject *__pyx_n_s_timeout_duration;
  PyObject *__pyx_n_s_timeout_func;
  PyObject *__pyx_n_s_timeout_func_locals_CustomTimeou;
  PyObject *__pyx_n_s_timeout_func_locals_handler;
  PyObject *__pyx_n_s_to_json;
  PyObject *__pyx_n_s_total;
  PyObject *__pyx_n_s_tqdm;
  PyObject *__pyx_n_s_trace;
  PyObject *__pyx_kp_u_trace_state_waiting_WHERE_id;
  PyObject *__pyx_n_s_traceback;
  PyObject *__pyx_n_s_transaction_queue;
  PyObject *__pyx_n_b_true;
  PyObject *__pyx_n_s_true;
  PyObject *__pyx_n_s_types;
  PyObject *__pyx_n_s_typing;
  PyObject *__pyx_n_s_unsync;
  PyObject *__pyx_kp_u_update_bue_session_ids_set_attem;
  PyObject *__pyx_kp_u_update_buelon_jobs_set_status;
  PyObject *__pyx_n_s_update_params;
  PyObject *__pyx_n_s_update_query;
  PyObject *__pyx_kp_u_update_steps_set_status;
  PyObject *__pyx_n_s_upload_pipe_code;
  PyObject *__pyx_n_s_upload_pipe_code_from_file;
  PyObject *__pyx_n_s_upload_pipe_code_locals_genexpr;
  PyObject *__pyx_kp_b_upload_step;
  PyObject *__pyx_kp_s_upload_step;
  PyObject *__pyx_n_s_upload_step_2;
  PyObject *__pyx_n_s_upload_step_3;
  PyObject *__pyx_n_s_upload_steps;
  PyObject *__pyx_n_s_upload_steps_2;
  PyObject *__pyx_kp_s_upload_steps_3;
  PyObject *__pyx_n_s_upload_table;
  PyObject *__pyx_n_s_uuid;
  PyObject *__pyx_n_s_uuid1;
  PyObject *__pyx_n_s_v;
  PyObject *__pyx_n_s_value;
  PyObject *__pyx_n_s_values;
  PyObject *__pyx_n_s_velocity;
  PyObject *__pyx_n_s_velocity_sql;
  PyObject *__pyx_n_s_wait_until_finish;
  PyObject *__pyx_n_s_waiting;
  PyObject *__pyx_n_s_waiting_priority;
  PyObject *__pyx_n_s_warn;
  PyObject *__pyx_n_s_warnings;
  PyObject *__pyx_n_s_where;
  PyObject *__pyx_kp_u_where_status;
  PyObject *__pyx_kp_u_where_status_2;
  PyObject *__pyx_kp_u_where_status_not_in;
  PyObject *__pyx_kp_u_where_status_not_in_2;
  PyObject *__pyx_n_s_worker;
  PyObject *__pyx_n_s_worker_thread;
  PyObject *__pyx_n_s_working;
  PyObject *__pyx_n_s_working_clause;
  PyObject *__pyx_n_s_write;
  PyObject *__pyx_n_s_zip;
  PyObject *__pyx_float_5_;
  PyObject *__pyx_float_10_;
  PyObject *__pyx_int_0;
  PyObject *__pyx_int_1;
  PyObject *__pyx_int_2;
  PyObject *__pyx_int_3;
  PyObject *__pyx_int_4;
  PyObject *__pyx_int_5;
  PyObject *__pyx_int_10;
  PyObject *__pyx_int_30;
  PyObject *__pyx_int_50;
  PyObject *__pyx_int_60;
  PyObject *__pyx_int_100;
  PyObject *__pyx_int_600;
  PyObject *__pyx_int_1000;
  PyObject *__pyx_int_1024;
  PyObject *__pyx_int_2000;
  PyObject *__pyx_int_65432;
  PyObject *__pyx_tuple_;
  PyObject *__pyx_tuple__5;
  PyObject *__pyx_tuple__6;
  PyObject *__pyx_tuple__7;
  PyObject *__pyx_tuple__17;
  PyObject *__pyx_tuple__18;
  PyObject *__pyx_tuple__19;
  PyObject *__pyx_tuple__25;
  PyObject *__pyx_tuple__26;
  PyObject *__pyx_tuple__27;
  PyObject *__pyx_tuple__28;
  PyObject *__pyx_tuple__36;
  PyObject *__pyx_tuple__37;
  PyObject *__pyx_tuple__40;
  PyObject *__pyx_tuple__41;
  PyObject *__pyx_tuple__43;
  PyObject *__pyx_tuple__46;
  PyObject *__pyx_tuple__52;
  PyObject *__pyx_tuple__53;
  PyObject *__pyx_tuple__55;
  PyObject *__pyx_tuple__57;
  PyObject *__pyx_tuple__58;
  PyObject *__pyx_tuple__59;
  PyObject *__pyx_tuple__60;
  PyObject *__pyx_tuple__61;
  PyObject *__pyx_tuple__62;
  PyObject *__pyx_tuple__63;
  PyObject *__pyx_tuple__64;
  PyObject *__pyx_tuple__65;
  PyObject *__pyx_tuple__66;
  PyObject *__pyx_tuple__67;
  PyObject *__pyx_tuple__71;
  PyObject *__pyx_tuple__73;
  PyObject *__pyx_tuple__74;
  PyObject *__pyx_tuple__76;
  PyObject *__pyx_tuple__78;
  PyObject *__pyx_tuple__80;
  PyObject *__pyx_tuple__82;
  PyObject *__pyx_tuple__84;
  PyObject *__pyx_tuple__86;
  PyObject *__pyx_tuple__87;
  PyObject *__pyx_tuple__89;
  PyObject *__pyx_tuple__90;
  PyObject *__pyx_tuple__92;
  PyObject *__pyx_tuple__93;
  PyObject *__pyx_tuple__95;
  PyObject *__pyx_tuple__97;
  PyObject *__pyx_tuple__99;
  PyObject *__pyx_codeobj__2;
  PyObject *__pyx_tuple__101;
  PyObject *__pyx_tuple__103;
  PyObject *__pyx_tuple__104;
  PyObject *__pyx_tuple__106;
  PyObject *__pyx_tuple__107;
  PyObject *__pyx_tuple__109;
  PyObject *__pyx_tuple__111;
  PyObject *__pyx_tuple__113;
  PyObject *__pyx_tuple__115;
  PyObject *__pyx_tuple__117;
  PyObject *__pyx_tuple__119;
  PyObject *__pyx_tuple__121;
  PyObject *__pyx_tuple__123;
  PyObject *__pyx_tuple__125;
  PyObject *__pyx_tuple__127;
  PyObject *__pyx_tuple__129;
  PyObject *__pyx_tuple__131;
  PyObject *__pyx_tuple__133;
  PyObject *__pyx_tuple__134;
  PyObject *__pyx_tuple__136;
  PyObject *__pyx_tuple__138;
  PyObject *__pyx_tuple__140;
  PyObject *__pyx_tuple__142;
  PyObject *__pyx_tuple__144;
  PyObject *__pyx_tuple__146;
  PyObject *__pyx_tuple__148;
  PyObject *__pyx_tuple__150;
  PyObject *__pyx_tuple__152;
  PyObject *__pyx_tuple__155;
  PyObject *__pyx_tuple__157;
  PyObject *__pyx_tuple__159;
  PyObject *__pyx_tuple__161;
  PyObject *__pyx_tuple__166;
  PyObject *__pyx_tuple__168;
  PyObject *__pyx_tuple__169;
  PyObject *__pyx_tuple__171;
  PyObject *__pyx_tuple__172;
  PyObject *__pyx_tuple__174;
  PyObject *__pyx_tuple__175;
  PyObject *__pyx_tuple__177;
  PyObject *__pyx_tuple__179;
  PyObject *__pyx_tuple__181;
  PyObject *__pyx_tuple__183;
  PyObject *__pyx_tuple__185;
  PyObject *__pyx_tuple__187;
  PyObject *__pyx_tuple__189;
  PyObject *__pyx_tuple__191;
  PyObject *__pyx_tuple__193;
  PyObject *__pyx_tuple__197;
  PyObject *__pyx_tuple__199;
  PyObject *__pyx_tuple__201;
  PyObject *__pyx_tuple__204;
  PyObject *__pyx_tuple__212;
  PyObject *__pyx_tuple__214;
  PyObject *__pyx_tuple__216;
  PyObject *__pyx_tuple__218;
  PyObject *__pyx_tuple__220;
  PyObject *__pyx_tuple__223;
  PyObject *__pyx_tuple__225;
  PyObject *__pyx_tuple__227;
  PyObject *__pyx_tuple__229;
  PyObject *__pyx_tuple__231;
  PyObject *__pyx_tuple__233;
  PyObject *__pyx_tuple__235;
  PyObject *__pyx_tuple__237;
  PyObject *__pyx_tuple__239;
  PyObject *__pyx_tuple__241;
  PyObject *__pyx_tuple__243;
  PyObject *__pyx_tuple__245;
  PyObject *__pyx_tuple__247;
  PyObject *__pyx_tuple__249;
  PyObject *__pyx_tuple__252;
  PyObject *__pyx_tuple__254;
  PyObject *__pyx_tuple__256;
  PyObject *__pyx_tuple__258;
  PyObject *__pyx_tuple__260;
  PyObject *__pyx_tuple__262;
  PyObject *__pyx_tuple__265;
  PyObject *__pyx_codeobj__29;
  PyObject *__pyx_codeobj__38;
  PyObject *__pyx_codeobj__47;
  PyObject *__pyx_codeobj__51;
  PyObject *__pyx_codeobj__54;
  PyObject *__pyx_codeobj__56;
  PyObject *__pyx_codeobj__70;
  PyObject *__pyx_codeobj__72;
  PyObject *__pyx_codeobj__75;
  PyObject *__pyx_codeobj__77;
  PyObject *__pyx_codeobj__79;
  PyObject *__pyx_codeobj__81;
  PyObject *__pyx_codeobj__83;
  PyObject *__pyx_codeobj__85;
  PyObject *__pyx_codeobj__88;
  PyObject *__pyx_codeobj__91;
  PyObject *__pyx_codeobj__94;
  PyObject *__pyx_codeobj__96;
  PyObject *__pyx_codeobj__98;
  PyObject *__pyx_codeobj__100;
  PyObject *__pyx_codeobj__102;
  PyObject *__pyx_codeobj__105;
  PyObject *__pyx_codeobj__108;
  PyObject *__pyx_codeobj__110;
  PyObject *__pyx_codeobj__112;
  PyObject *__pyx_codeobj__114;
  PyObject *__pyx_codeobj__116;
  PyObject *__pyx_codeobj__118;
  PyObject *__pyx_codeobj__120;
  PyObject *__pyx_codeobj__122;
  PyObject *__pyx_codeobj__124;
  PyObject *__pyx_codeobj__126;
  PyObject *__pyx_codeobj__128;
  PyObject *__pyx_codeobj__130;
  PyObject *__pyx_codeobj__132;
  PyObject *__pyx_codeobj__135;
  PyObject *__pyx_codeobj__137;
  PyObject *__pyx_codeobj__139;
  PyObject *__pyx_codeobj__141;
  PyObject *__pyx_codeobj__143;
  PyObject *__pyx_codeobj__145;
  PyObject *__pyx_codeobj__147;
  PyObject *__pyx_codeobj__149;
  PyObject *__pyx_codeobj__151;
  PyObject *__pyx_codeobj__153;
  PyObject *__pyx_codeobj__154;
  PyObject *__pyx_codeobj__156;
  PyObject *__pyx_codeobj__158;
  PyObject *__pyx_codeobj__160;
  PyObject *__pyx_codeobj__162;
  PyObject *__pyx_codeobj__163;
  PyObject *__pyx_codeobj__164;
  PyObject *__pyx_codeobj__165;
  PyObject *__pyx_codeobj__167;
  PyObject *__pyx_codeobj__170;
  PyObject *__pyx_codeobj__173;
  PyObject *__pyx_codeobj__176;
  PyObject *__pyx_codeobj__178;
  PyObject *__pyx_codeobj__180;
  PyObject *__pyx_codeobj__182;
  PyObject *__pyx_codeobj__184;
  PyObject *__pyx_codeobj__186;
  PyObject *__pyx_codeobj__188;
  PyObject *__pyx_codeobj__190;
  PyObject *__pyx_codeobj__192;
  PyObject *__pyx_codeobj__194;
  PyObject *__pyx_codeobj__195;
  PyObject *__pyx_codeobj__196;
  PyObject *__pyx_codeobj__198;
  PyObject *__pyx_codeobj__200;
  PyObject *__pyx_codeobj__202;
  PyObject *__pyx_codeobj__203;
  PyObject *__pyx_codeobj__205;
  PyObject *__pyx_codeobj__206;
  PyObject *__pyx_codeobj__207;
  PyObject *__pyx_codeobj__208;
  PyObject *__pyx_codeobj__209;
  PyObject *__pyx_codeobj__210;
  PyObject *__pyx_codeobj__211;
  PyObject *__pyx_codeobj__213;
  PyObject *__pyx_codeobj__215;
  PyObject *__pyx_codeobj__217;
  PyObject *__pyx_codeobj__219;
  PyObject *__pyx_codeobj__221;
  PyObject *__pyx_codeobj__222;
  PyObject *__pyx_codeobj__224;
  PyObject *__pyx_codeobj__226;
  PyObject *__pyx_codeobj__228;
  PyObject *__pyx_codeobj__230;
  PyObject *__pyx_codeobj__232;
  PyObject *__pyx_codeobj__234;
  PyObject *__pyx_codeobj__236;
  PyObject *__pyx_codeobj__238;
  PyObject *__pyx_codeobj__240;
  PyObject *__pyx_codeobj__242;
  PyObject *__pyx_codeobj__244;
  PyObject *__pyx_codeobj__246;
  PyObject *__pyx_codeobj__248;
  PyObject *__pyx_codeobj__250;
  PyObject *__pyx_codeobj__251;
  PyObject *__pyx_codeobj__253;
  PyObject *__pyx_codeobj__255;
  PyObject *__pyx_codeobj__257;
  PyObject *__pyx_codeobj__259;
  PyObject *__pyx_codeobj__261;
  PyObject *__pyx_codeobj__263;
  PyObject *__pyx_codeobj__264;
  PyObject *__pyx_codeobj__266;
} __pyx_mstate;

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

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

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

#define __pyx_m (PyState_FindModule(&__pyx_moduledef))
#else
static __pyx_mstate __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_clear(PyObject *m) {
  __pyx_mstate *clear_module_state = __pyx_mstate(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair);
  Py_CLEAR(clear_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr);
  Py_CLEAR(clear_module_state->__pyx_kp_u_0);
  Py_CLEAR(clear_module_state->__pyx_kp_s_0_0_0_0);
  Py_CLEAR(clear_module_state->__pyx_n_s_AF_INET);
  Py_CLEAR(clear_module_state->__pyx_kp_s_AND_not);
  Py_CLEAR(clear_module_state->__pyx_kp_u_AND_not_lower_msg_like);
  Py_CLEAR(clear_module_state->__pyx_kp_u_AND_s_status);
  Py_CLEAR(clear_module_state->__pyx_kp_u_AND_s_status_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_AND_s_status_3);
  Py_CLEAR(clear_module_state->__pyx_kp_u_AND_status);
  Py_CLEAR(clear_module_state->__pyx_kp_u_AND_status_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_Any);
  Py_CLEAR(clear_module_state->__pyx_n_s_AttributeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_CANCEL);
  Py_CLEAR(clear_module_state->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s);
  Py_CLEAR(clear_module_state->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_2);
  Py_CLEAR(clear_module_state->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_3);
  Py_CLEAR(clear_module_state->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_4);
  Py_CLEAR(clear_module_state->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_5);
  Py_CLEAR(clear_module_state->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_6);
  Py_CLEAR(clear_module_state->__pyx_kp_s_CREATE_INDEX_if_not_exists_idx_b);
  Py_CLEAR(clear_module_state->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo);
  Py_CLEAR(clear_module_state->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_2);
  Py_CLEAR(clear_module_state->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_3);
  Py_CLEAR(clear_module_state->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_steps);
  Py_CLEAR(clear_module_state->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags);
  Py_CLEAR(clear_module_state->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags_2);
  Py_CLEAR(clear_module_state->__pyx_kp_s_CREATE_UNIQUE_INDEX_IF_NOT_EXIST);
  Py_CLEAR(clear_module_state->__pyx_n_s_Callable);
  Py_CLEAR(clear_module_state->__pyx_n_s_Client);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConnectionRefusedError);
  Py_CLEAR(clear_module_state->__pyx_n_s_CustomTimeoutError);
  Py_CLEAR(clear_module_state->__pyx_n_s_DEFAULT_SCOPES);
  Py_CLEAR(clear_module_state->__pyx_n_s_DELETE_STEPS);
  Py_CLEAR(clear_module_state->__pyx_n_s_DONE);
  Py_CLEAR(clear_module_state->__pyx_n_s_Done);
  Py_CLEAR(clear_module_state->__pyx_n_s_ERROR);
  Py_CLEAR(clear_module_state->__pyx_n_s_Enum);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Error);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Error_processing_transaction);
  Py_CLEAR(clear_module_state->__pyx_kp_s_F);
  Py_CLEAR(clear_module_state->__pyx_n_s_FETCH_ERRORS);
  Py_CLEAR(clear_module_state->__pyx_n_s_FETCH_ROWS);
  Py_CLEAR(clear_module_state->__pyx_kp_u_FOR_UPDATE_SKIP_LOCKED);
  Py_CLEAR(clear_module_state->__pyx_kp_u_FOR_UPDATE_SKIP_LOCKED_RETURNIN);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Fetching_data_for_jobs_by_1_000);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Fetching_parents_of_jobs_by_1_00);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Fetching_queued_not_finished_job);
  Py_CLEAR(clear_module_state->__pyx_n_s_GET_STEPS);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient___enter);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient___exit);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient___getattr);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient___init);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient__already);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_cancel);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_cancels);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_close);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_connect);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_delete_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_done);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_dones);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_error);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_fetch_errors);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_get_rows);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_get_step_count);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_get_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_load_pg);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_pending);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_pendings);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_cancel);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_cancels);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_cancels_local);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_delete_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_done);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_done_locals_g);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_dones);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_dones_locals);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_error);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_fetch_errors);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_fetch_errors_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_fetch_errors_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_fetch_errors_4);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_get_rows);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_get_step_coun);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_get_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_get_steps_loc);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_get_steps_loc_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_pending);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_pendings);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_pendings_loca);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_repair);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_repair_locals);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_repair_locals_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_repair_locals_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_reset);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_reset_errors);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_resets);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_resets_locals);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_upload_step);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_postgres_upload_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_repair);
  Py_CLEAR(clear_module_state->__pyx_kp_s_HubClient_repair_is_only_impleme);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_reset);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_reset_errors);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_resets);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_send_request);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_upload_step);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubClient_upload_steps);
  Py_CLEAR(clear_module_state->__pyx_kp_s_HubClient_used_outside_the_main);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubServer);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubServer___init);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubServer__execute_request);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubServer__execute_transaction);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubServer__handle_client);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubServer__process_request);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubServer__process_request_local);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubServer__process_transactions);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubServer_create_db_pool);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubServer_execute_db_query);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubServer_execute_db_query_local);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubServer_get_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubServer_get_steps_locals_genex);
  Py_CLEAR(clear_module_state->__pyx_n_s_HubServer_start);
  Py_CLEAR(clear_module_state->__pyx_kp_s_INSERT_INTO_buelon_jobs_waiting);
  Py_CLEAR(clear_module_state->__pyx_kp_s_INSERT_INTO_steps_id_priority_sc);
  Py_CLEAR(clear_module_state->__pyx_n_s_IPPROTO_TCP);
  Py_CLEAR(clear_module_state->__pyx_n_s_InsufficientPrivilege);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Insufficient_privileges_to_creat);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_method);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_value_received);
  Py_CLEAR(clear_module_state->__pyx_kp_s_K);
  Py_CLEAR(clear_module_state->__pyx_n_s_KeyboardInterrupt);
  Py_CLEAR(clear_module_state->__pyx_n_s_LENGTH_OF_PIPELINE_END_TOKEN);
  Py_CLEAR(clear_module_state->__pyx_kp_u_LIMIT);
  Py_CLEAR(clear_module_state->__pyx_kp_u_LIMIT_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_LIMIT_3);
  Py_CLEAR(clear_module_state->__pyx_kp_u_LIMIT_4);
  Py_CLEAR(clear_module_state->__pyx_kp_u_LIMIT_5);
  Py_CLEAR(clear_module_state->__pyx_kp_u_LIMIT_OFFSET);
  Py_CLEAR(clear_module_state->__pyx_n_s_Lock);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Max_errors_met);
  Py_CLEAR(clear_module_state->__pyx_n_s_Method);
  Py_CLEAR(clear_module_state->__pyx_n_s_ModuleNotFoundError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_No_data_found_for_step);
  Py_CLEAR(clear_module_state->__pyx_n_s_None);
  Py_CLEAR(clear_module_state->__pyx_kp_u_None);
  Py_CLEAR(clear_module_state->__pyx_kp_s_OR);
  Py_CLEAR(clear_module_state->__pyx_kp_u_ORDER_BY);
  Py_CLEAR(clear_module_state->__pyx_kp_u_ORDER_BY_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_ORDER_BY_3);
  Py_CLEAR(clear_module_state->__pyx_kp_u_ORDER_BY_4);
  Py_CLEAR(clear_module_state->__pyx_kp_u_OR_epoch_coalesce_timeout);
  Py_CLEAR(clear_module_state->__pyx_kp_u_OR_lower_trace_like);
  Py_CLEAR(clear_module_state->__pyx_n_s_OSError);
  Py_CLEAR(clear_module_state->__pyx_n_s_PENDING);
  Py_CLEAR(clear_module_state->__pyx_n_s_PIPELINE_END_TOKEN);
  Py_CLEAR(clear_module_state->__pyx_n_s_PIPELINE_HOST);
  Py_CLEAR(clear_module_state->__pyx_n_s_PIPELINE_PORT);
  Py_CLEAR(clear_module_state->__pyx_n_s_PIPELINE_SPLIT_TOKEN);
  Py_CLEAR(clear_module_state->__pyx_n_s_PIPE_WORKER_HOST);
  Py_CLEAR(clear_module_state->__pyx_n_s_PIPE_WORKER_PORT);
  Py_CLEAR(clear_module_state->__pyx_kp_s_PRAGMA_journal_mode_WAL);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Port);
  Py_CLEAR(clear_module_state->__pyx_n_s_Queue);
  Py_CLEAR(clear_module_state->__pyx_n_s_RESET);
  Py_CLEAR(clear_module_state->__pyx_n_s_RESET_ERRORS);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Repairing_Steps_Commits_every_1);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Request_timed_out_after);
  Py_CLEAR(clear_module_state->__pyx_kp_u_SELECT_COUNT_FROM_buelon_jobs_WH);
  Py_CLEAR(clear_module_state->__pyx_kp_u_SELECT_COUNT_FROM_steps_WHERE_st);
  Py_CLEAR(clear_module_state->__pyx_kp_u_SELECT_FROM_buelon_jobs_WHERE_id);
  Py_CLEAR(clear_module_state->__pyx_kp_u_SELECT_FROM_steps_WHERE_id);
  Py_CLEAR(clear_module_state->__pyx_kp_u_SELECT_id_msg_trace_FROM_buelon);
  Py_CLEAR(clear_module_state->__pyx_kp_u_SELECT_id_msg_trace_FROM_steps_W);
  Py_CLEAR(clear_module_state->__pyx_kp_u_SELECT_id_priority_scope_velocit);
  Py_CLEAR(clear_module_state->__pyx_kp_u_SELECT_s_id_s_id_s_priority_s_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_SELECT_status_FROM_steps_WHERE_i);
  Py_CLEAR(clear_module_state->__pyx_kp_s_SELECT_tag_velocity_FROM_tags);
  Py_CLEAR(clear_module_state->__pyx_n_s_SHUT_RDWR);
  Py_CLEAR(clear_module_state->__pyx_n_s_SIGALRM);
  Py_CLEAR(clear_module_state->__pyx_n_s_SOCK_STREAM);
  Py_CLEAR(clear_module_state->__pyx_n_s_SQLiteQueue);
  Py_CLEAR(clear_module_state->__pyx_n_s_STEP_COUNT);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Server_listening_on);
  Py_CLEAR(clear_module_state->__pyx_n_s_Step);
  Py_CLEAR(clear_module_state->__pyx_n_s_StepStatus);
  Py_CLEAR(clear_module_state->__pyx_kp_s_TAB_scope_scope_priority_priorit);
  Py_CLEAR(clear_module_state->__pyx_n_s_TCP_NODELAY);
  Py_CLEAR(clear_module_state->__pyx_n_s_Thread);
  Py_CLEAR(clear_module_state->__pyx_n_s_ThreadPoolExecutor);
  Py_CLEAR(clear_module_state->__pyx_n_s_ThreadSafeSQLiteQueue);
  Py_CLEAR(clear_module_state->__pyx_n_s_ThreadSafeSQLiteQueue___init);
  Py_CLEAR(clear_module_state->__pyx_n_s_ThreadSafeSQLiteQueue__get_queue);
  Py_CLEAR(clear_module_state->__pyx_n_s_ThreadSafeSQLiteQueue_get);
  Py_CLEAR(clear_module_state->__pyx_n_s_ThreadSafeSQLiteQueue_put);
  Py_CLEAR(clear_module_state->__pyx_n_s_ThreadSafeSQLiteQueue_qsize);
  Py_CLEAR(clear_module_state->__pyx_n_s_ThreadSafeSQLiteQueue_task_done);
  Py_CLEAR(clear_module_state->__pyx_n_s_TimeoutError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  Py_CLEAR(clear_module_state->__pyx_kp_u_UPDATE_buelon_jobs_s_SET_state);
  Py_CLEAR(clear_module_state->__pyx_kp_u_UPDATE_steps_SET_status);
  Py_CLEAR(clear_module_state->__pyx_kp_u_UPDATE_steps_SET_status_epoch_W);
  Py_CLEAR(clear_module_state->__pyx_n_s_UPLOAD_STEP);
  Py_CLEAR(clear_module_state->__pyx_n_s_UPLOAD_STEPS);
  Py_CLEAR(clear_module_state->__pyx_n_s_USING_POSTGRES);
  Py_CLEAR(clear_module_state->__pyx_n_s_USING_POSTGRES_HUB);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Uploading_Jobs);
  Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_WHEN_THEN);
  Py_CLEAR(clear_module_state->__pyx_kp_u_WHERE_id_IN);
  Py_CLEAR(clear_module_state->__pyx_kp_u_WHERE_s_id_IN_SELECT_s_id_FROM);
  Py_CLEAR(clear_module_state->__pyx_kp_u_WITH_updated_jobs_AS_UPDATE_bue);
  Py_CLEAR(clear_module_state->__pyx_n_s_WORKER_HOST);
  Py_CLEAR(clear_module_state->__pyx_n_s_WORKER_PORT);
  Py_CLEAR(clear_module_state->__pyx_n_s_Windows);
  Py_CLEAR(clear_module_state->__pyx_kp_s__10);
  Py_CLEAR(clear_module_state->__pyx_kp_u__10);
  Py_CLEAR(clear_module_state->__pyx_kp_s__11);
  Py_CLEAR(clear_module_state->__pyx_kp_u__12);
  Py_CLEAR(clear_module_state->__pyx_kp_u__13);
  Py_CLEAR(clear_module_state->__pyx_kp_s__14);
  Py_CLEAR(clear_module_state->__pyx_kp_u__14);
  Py_CLEAR(clear_module_state->__pyx_kp_s__15);
  Py_CLEAR(clear_module_state->__pyx_kp_u__16);
  Py_CLEAR(clear_module_state->__pyx_kp_s__20);
  Py_CLEAR(clear_module_state->__pyx_kp_s__21);
  Py_CLEAR(clear_module_state->__pyx_kp_s__22);
  Py_CLEAR(clear_module_state->__pyx_kp_s__23);
  Py_CLEAR(clear_module_state->__pyx_kp_u__23);
  Py_CLEAR(clear_module_state->__pyx_kp_u__24);
  Py_CLEAR(clear_module_state->__pyx_kp_b__3);
  Py_CLEAR(clear_module_state->__pyx_kp_s__3);
  Py_CLEAR(clear_module_state->__pyx_kp_u__30);
  Py_CLEAR(clear_module_state->__pyx_kp_u__31);
  Py_CLEAR(clear_module_state->__pyx_kp_s__32);
  Py_CLEAR(clear_module_state->__pyx_kp_s__33);
  Py_CLEAR(clear_module_state->__pyx_kp_u__34);
  Py_CLEAR(clear_module_state->__pyx_kp_u__35);
  Py_CLEAR(clear_module_state->__pyx_kp_u__39);
  Py_CLEAR(clear_module_state->__pyx_kp_u__4);
  Py_CLEAR(clear_module_state->__pyx_kp_u__42);
  Py_CLEAR(clear_module_state->__pyx_kp_u__44);
  Py_CLEAR(clear_module_state->__pyx_kp_u__45);
  Py_CLEAR(clear_module_state->__pyx_kp_u__48);
  Py_CLEAR(clear_module_state->__pyx_kp_u__49);
  Py_CLEAR(clear_module_state->__pyx_kp_u__50);
  Py_CLEAR(clear_module_state->__pyx_kp_b__68);
  Py_CLEAR(clear_module_state->__pyx_kp_b__69);
  Py_CLEAR(clear_module_state->__pyx_kp_u__8);
  Py_CLEAR(clear_module_state->__pyx_kp_u__9);
  Py_CLEAR(clear_module_state->__pyx_kp_s_abcdefghijklmnopqrstuvwxyzABCDE);
  Py_CLEAR(clear_module_state->__pyx_n_s_accept);
  Py_CLEAR(clear_module_state->__pyx_n_s_active);
  Py_CLEAR(clear_module_state->__pyx_n_s_add);
  Py_CLEAR(clear_module_state->__pyx_n_s_addr);
  Py_CLEAR(clear_module_state->__pyx_n_s_alarm);
  Py_CLEAR(clear_module_state->__pyx_n_s_all);
  Py_CLEAR(clear_module_state->__pyx_n_s_allow_chars);
  Py_CLEAR(clear_module_state->__pyx_n_s_already);
  Py_CLEAR(clear_module_state->__pyx_n_s_already_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_amount);
  Py_CLEAR(clear_module_state->__pyx_kp_u_and_status);
  Py_CLEAR(clear_module_state->__pyx_n_s_append);
  Py_CLEAR(clear_module_state->__pyx_n_s_args);
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio);
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_tasks);
  Py_CLEAR(clear_module_state->__pyx_n_s_attempt);
  Py_CLEAR(clear_module_state->__pyx_n_s_attempts);
  Py_CLEAR(clear_module_state->__pyx_n_s_auto_commit);
  Py_CLEAR(clear_module_state->__pyx_n_s_b);
  Py_CLEAR(clear_module_state->__pyx_n_s_bind);
  Py_CLEAR(clear_module_state->__pyx_n_s_bool);
  Py_CLEAR(clear_module_state->__pyx_n_s_bucket);
  Py_CLEAR(clear_module_state->__pyx_n_s_bucket_client);
  Py_CLEAR(clear_module_state->__pyx_n_s_buelon);
  Py_CLEAR(clear_module_state->__pyx_n_s_buelon_bucket);
  Py_CLEAR(clear_module_state->__pyx_n_s_buelon_core_pipe_debug);
  Py_CLEAR(clear_module_state->__pyx_n_s_buelon_core_pipe_interpreter);
  Py_CLEAR(clear_module_state->__pyx_n_s_buelon_core_step);
  Py_CLEAR(clear_module_state->__pyx_kp_s_buelon_core_step_Step);
  Py_CLEAR(clear_module_state->__pyx_kp_s_buelon_core_step_StepStatus);
  Py_CLEAR(clear_module_state->__pyx_kp_s_buelon_core_step_Step_None);
  Py_CLEAR(clear_module_state->__pyx_n_s_buelon_cython_c_hub);
  Py_CLEAR(clear_module_state->__pyx_kp_s_buelon_cython_c_hub_pyx);
  Py_CLEAR(clear_module_state->__pyx_n_s_buelon_helpers_json_parser);
  Py_CLEAR(clear_module_state->__pyx_n_s_buelon_helpers_lazy_load_class);
  Py_CLEAR(clear_module_state->__pyx_n_s_buelon_status_map);
  Py_CLEAR(clear_module_state->__pyx_kp_u_buj_left_join_buelon_status_map);
  Py_CLEAR(clear_module_state->__pyx_n_s_bulk);
  Py_CLEAR(clear_module_state->__pyx_n_s_bulk_get);
  Py_CLEAR(clear_module_state->__pyx_n_s_bulk_get_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_bulk_get_step);
  Py_CLEAR(clear_module_state->__pyx_n_s_bulk_set);
  Py_CLEAR(clear_module_state->__pyx_n_s_bulk_set_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_bytes);
  Py_CLEAR(clear_module_state->__pyx_n_s_c);
  Py_CLEAR(clear_module_state->__pyx_kp_s_callable_None);
  Py_CLEAR(clear_module_state->__pyx_n_s_cancel);
  Py_CLEAR(clear_module_state->__pyx_n_s_cancel_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_cancels);
  Py_CLEAR(clear_module_state->__pyx_n_s_case_statement);
  Py_CLEAR(clear_module_state->__pyx_n_s_check_active_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_check_to_delete_bucket_files);
  Py_CLEAR(clear_module_state->__pyx_n_s_check_to_delete_bucket_files_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_child);
  Py_CLEAR(clear_module_state->__pyx_n_s_children);
  Py_CLEAR(clear_module_state->__pyx_n_s_children_params);
  Py_CLEAR(clear_module_state->__pyx_n_s_chunk);
  Py_CLEAR(clear_module_state->__pyx_n_s_chunk_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_clean_query_string);
  Py_CLEAR(clear_module_state->__pyx_n_s_clear);
  Py_CLEAR(clear_module_state->__pyx_n_s_client);
  Py_CLEAR(clear_module_state->__pyx_n_s_client_socket);
  Py_CLEAR(clear_module_state->__pyx_n_s_client_thread);
  Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
  Py_CLEAR(clear_module_state->__pyx_n_s_close);
  Py_CLEAR(clear_module_state->__pyx_n_s_code);
  Py_CLEAR(clear_module_state->__pyx_n_s_collections);
  Py_CLEAR(clear_module_state->__pyx_n_s_commit);
  Py_CLEAR(clear_module_state->__pyx_n_s_concurrent_futures);
  Py_CLEAR(clear_module_state->__pyx_n_s_config);
  Py_CLEAR(clear_module_state->__pyx_n_s_conn);
  Py_CLEAR(clear_module_state->__pyx_n_s_connect);
  Py_CLEAR(clear_module_state->__pyx_n_s_connection_queue);
  Py_CLEAR(clear_module_state->__pyx_n_s_core);
  Py_CLEAR(clear_module_state->__pyx_n_s_count);
  Py_CLEAR(clear_module_state->__pyx_kp_s_count_must_be_an_integer);
  Py_CLEAR(clear_module_state->__pyx_n_s_create_db_pool);
  Py_CLEAR(clear_module_state->__pyx_kp_s_create_index_if_not_exists_idx_b);
  Py_CLEAR(clear_module_state->__pyx_kp_s_create_index_if_not_exists_idx_b_2);
  Py_CLEAR(clear_module_state->__pyx_kp_s_create_index_if_not_exists_idx_b_3);
  Py_CLEAR(clear_module_state->__pyx_kp_s_create_index_if_not_exists_idx_b_4);
  Py_CLEAR(clear_module_state->__pyx_kp_s_create_table_bue_session_ids_id);
  Py_CLEAR(clear_module_state->__pyx_kp_s_create_table_if_not_exists_buelo);
  Py_CLEAR(clear_module_state->__pyx_n_s_cur);
  Py_CLEAR(clear_module_state->__pyx_n_s_cursor);
  Py_CLEAR(clear_module_state->__pyx_n_s_d);
  Py_CLEAR(clear_module_state->__pyx_n_s_daemon);
  Py_CLEAR(clear_module_state->__pyx_n_s_data);
  Py_CLEAR(clear_module_state->__pyx_kp_s_database_db);
  Py_CLEAR(clear_module_state->__pyx_n_s_db);
  Py_CLEAR(clear_module_state->__pyx_n_s_db_operation);
  Py_CLEAR(clear_module_state->__pyx_n_s_db_path);
  Py_CLEAR(clear_module_state->__pyx_n_s_db_pool);
  Py_CLEAR(clear_module_state->__pyx_n_s_decode);
  Py_CLEAR(clear_module_state->__pyx_n_s_decrement_tag_usage);
  Py_CLEAR(clear_module_state->__pyx_n_s_default);
  Py_CLEAR(clear_module_state->__pyx_n_s_defaultdict);
  Py_CLEAR(clear_module_state->__pyx_n_s_delete);
  Py_CLEAR(clear_module_state->__pyx_kp_u_delete_from_bue_session_ids_wher);
  Py_CLEAR(clear_module_state->__pyx_kp_s_delete_from_buelon_jobs);
  Py_CLEAR(clear_module_state->__pyx_kp_s_delete_from_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_delete_last_line);
  Py_CLEAR(clear_module_state->__pyx_kp_b_delete_steps);
  Py_CLEAR(clear_module_state->__pyx_kp_s_delete_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_delete_steps_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_delete_steps_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_desc);
  Py_CLEAR(clear_module_state->__pyx_n_s_description);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict_2);
  Py_CLEAR(clear_module_state->__pyx_kp_s_dict_str_Any);
  Py_CLEAR(clear_module_state->__pyx_kp_s_dict_str_buelon_core_step_Step_N);
  Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
  Py_CLEAR(clear_module_state->__pyx_n_s_doc);
  Py_CLEAR(clear_module_state->__pyx_n_s_done);
  Py_CLEAR(clear_module_state->__pyx_n_s_done_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_dones);
  Py_CLEAR(clear_module_state->__pyx_n_s_dotenv);
  Py_CLEAR(clear_module_state->__pyx_n_s_download_table);
  Py_CLEAR(clear_module_state->__pyx_kp_s_drop_table_bue_session_ids);
  Py_CLEAR(clear_module_state->__pyx_kp_s_drop_table_if_exists_bue_session);
  Py_CLEAR(clear_module_state->__pyx_n_s_dumps);
  Py_CLEAR(clear_module_state->__pyx_n_s_e);
  Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
  Py_CLEAR(clear_module_state->__pyx_n_s_encode);
  Py_CLEAR(clear_module_state->__pyx_n_s_end);
  Py_CLEAR(clear_module_state->__pyx_n_s_endswith);
  Py_CLEAR(clear_module_state->__pyx_n_s_enter);
  Py_CLEAR(clear_module_state->__pyx_n_s_enum);
  Py_CLEAR(clear_module_state->__pyx_kp_s_env);
  Py_CLEAR(clear_module_state->__pyx_n_s_environ);
  Py_CLEAR(clear_module_state->__pyx_kp_u_epoch);
  Py_CLEAR(clear_module_state->__pyx_kp_u_epoch_WHERE_id);
  Py_CLEAR(clear_module_state->__pyx_kp_u_epoch_WHERE_id_IN);
  Py_CLEAR(clear_module_state->__pyx_kp_u_epoch_msg_trace_WHERE_id);
  Py_CLEAR(clear_module_state->__pyx_n_s_error);
  Py_CLEAR(clear_module_state->__pyx_n_s_error_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_error_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_error_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_error_size_query);
  Py_CLEAR(clear_module_state->__pyx_n_s_errors);
  Py_CLEAR(clear_module_state->__pyx_n_s_exc);
  Py_CLEAR(clear_module_state->__pyx_n_s_exc_tb);
  Py_CLEAR(clear_module_state->__pyx_n_s_exc_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_exc_val);
  Py_CLEAR(clear_module_state->__pyx_n_s_exclude);
  Py_CLEAR(clear_module_state->__pyx_kp_s_exclude_must_be_a_list_of_string);
  Py_CLEAR(clear_module_state->__pyx_kp_s_exclude_must_be_a_string_or_a_li);
  Py_CLEAR(clear_module_state->__pyx_n_s_exclude_query);
  Py_CLEAR(clear_module_state->__pyx_n_s_execute);
  Py_CLEAR(clear_module_state->__pyx_n_s_execute_batch);
  Py_CLEAR(clear_module_state->__pyx_n_s_execute_db_query);
  Py_CLEAR(clear_module_state->__pyx_n_s_execute_request);
  Py_CLEAR(clear_module_state->__pyx_n_s_execute_transaction);
  Py_CLEAR(clear_module_state->__pyx_n_s_executing);
  Py_CLEAR(clear_module_state->__pyx_n_s_execution_queue);
  Py_CLEAR(clear_module_state->__pyx_n_s_executor_thread);
  Py_CLEAR(clear_module_state->__pyx_n_s_exit);
  Py_CLEAR(clear_module_state->__pyx_n_s_exit_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_expiration_time);
  Py_CLEAR(clear_module_state->__pyx_n_s_extras);
  Py_CLEAR(clear_module_state->__pyx_n_s_f);
  Py_CLEAR(clear_module_state->__pyx_n_s_fail);
  Py_CLEAR(clear_module_state->__pyx_n_b_false);
  Py_CLEAR(clear_module_state->__pyx_n_s_false);
  Py_CLEAR(clear_module_state->__pyx_n_s_fetch_errors);
  Py_CLEAR(clear_module_state->__pyx_kp_s_fetch_errors_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_fetch_errors_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_fetch_errors_locals_clean_query);
  Py_CLEAR(clear_module_state->__pyx_n_s_fetch_errors_locals_clean_query_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_fetch_errors_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_kp_s_fetch_rows);
  Py_CLEAR(clear_module_state->__pyx_n_s_fetchall);
  Py_CLEAR(clear_module_state->__pyx_n_s_file_path);
  Py_CLEAR(clear_module_state->__pyx_n_s_finished_statuses);
  Py_CLEAR(clear_module_state->__pyx_n_s_first_iteration);
  Py_CLEAR(clear_module_state->__pyx_n_s_format);
  Py_CLEAR(clear_module_state->__pyx_n_s_frame);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_json);
  Py_CLEAR(clear_module_state->__pyx_n_s_func);
  Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
  Py_CLEAR(clear_module_state->__pyx_n_s_generate_steps_from_code);
  Py_CLEAR(clear_module_state->__pyx_n_s_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_get);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_job_statuses);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_job_statuses_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_postgres_from_env);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_queue);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_rows);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_statuses);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_step);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_step_count);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_step_count_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_step_status);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_steps);
  Py_CLEAR(clear_module_state->__pyx_kp_s_get_steps_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_getattr);
  Py_CLEAR(clear_module_state->__pyx_kp_u_group_by_status);
  Py_CLEAR(clear_module_state->__pyx_kp_u_group_by_status_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_handle_client);
  Py_CLEAR(clear_module_state->__pyx_n_s_handler);
  Py_CLEAR(clear_module_state->__pyx_n_s_headers);
  Py_CLEAR(clear_module_state->__pyx_n_s_helpers);
  Py_CLEAR(clear_module_state->__pyx_n_s_host);
  Py_CLEAR(clear_module_state->__pyx_n_s_hub);
  Py_CLEAR(clear_module_state->__pyx_n_s_i);
  Py_CLEAR(clear_module_state->__pyx_n_s_id);
  Py_CLEAR(clear_module_state->__pyx_kp_u_id_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_id_IN);
  Py_CLEAR(clear_module_state->__pyx_n_s_id_column);
  Py_CLEAR(clear_module_state->__pyx_kp_s_id_in);
  Py_CLEAR(clear_module_state->__pyx_n_s_ids);
  Py_CLEAR(clear_module_state->__pyx_n_s_import);
  Py_CLEAR(clear_module_state->__pyx_n_s_include_workers);
  Py_CLEAR(clear_module_state->__pyx_n_s_include_working);
  Py_CLEAR(clear_module_state->__pyx_n_s_increments);
  Py_CLEAR(clear_module_state->__pyx_n_s_index);
  Py_CLEAR(clear_module_state->__pyx_n_s_init);
  Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
  Py_CLEAR(clear_module_state->__pyx_kp_u_insert_into_bue_session_ids_id_a);
  Py_CLEAR(clear_module_state->__pyx_n_s_inspect);
  Py_CLEAR(clear_module_state->__pyx_n_s_int);
  Py_CLEAR(clear_module_state->__pyx_kp_s_int_float);
  Py_CLEAR(clear_module_state->__pyx_kp_s_int_float_Callable);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_already_in_use_Retrying);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
  Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
  Py_CLEAR(clear_module_state->__pyx_n_s_item);
  Py_CLEAR(clear_module_state->__pyx_n_s_items);
  Py_CLEAR(clear_module_state->__pyx_n_s_job);
  Py_CLEAR(clear_module_state->__pyx_n_s_job_handler);
  Py_CLEAR(clear_module_state->__pyx_n_s_job_ids);
  Py_CLEAR(clear_module_state->__pyx_n_s_join);
  Py_CLEAR(clear_module_state->__pyx_n_s_json_parser);
  Py_CLEAR(clear_module_state->__pyx_n_s_json_table);
  Py_CLEAR(clear_module_state->__pyx_n_s_k);
  Py_CLEAR(clear_module_state->__pyx_n_s_key);
  Py_CLEAR(clear_module_state->__pyx_n_s_key_map);
  Py_CLEAR(clear_module_state->__pyx_n_s_keys);
  Py_CLEAR(clear_module_state->__pyx_n_s_kwargs);
  Py_CLEAR(clear_module_state->__pyx_n_s_lazy_load_class);
  Py_CLEAR(clear_module_state->__pyx_n_s_lazy_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_limit);
  Py_CLEAR(clear_module_state->__pyx_n_s_list);
  Py_CLEAR(clear_module_state->__pyx_kp_s_list_None);
  Py_CLEAR(clear_module_state->__pyx_kp_s_list_buelon_core_step_Step);
  Py_CLEAR(clear_module_state->__pyx_kp_s_list_dict);
  Py_CLEAR(clear_module_state->__pyx_kp_s_list_str);
  Py_CLEAR(clear_module_state->__pyx_kp_s_list_str_str_None);
  Py_CLEAR(clear_module_state->__pyx_n_s_listen);
  Py_CLEAR(clear_module_state->__pyx_n_s_load_db);
  Py_CLEAR(clear_module_state->__pyx_n_s_load_dotenv);
  Py_CLEAR(clear_module_state->__pyx_n_s_load_pg);
  Py_CLEAR(clear_module_state->__pyx_n_s_loads);
  Py_CLEAR(clear_module_state->__pyx_n_s_local);
  Py_CLEAR(clear_module_state->__pyx_n_s_localhost);
  Py_CLEAR(clear_module_state->__pyx_kp_u_lower_msg_like);
  Py_CLEAR(clear_module_state->__pyx_n_s_main);
  Py_CLEAR(clear_module_state->__pyx_n_s_main_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_max_connections);
  Py_CLEAR(clear_module_state->__pyx_n_s_max_reconnect_attempts);
  Py_CLEAR(clear_module_state->__pyx_n_s_max_workers);
  Py_CLEAR(clear_module_state->__pyx_n_s_metaclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_method);
  Py_CLEAR(clear_module_state->__pyx_n_s_min_table_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_module);
  Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries);
  Py_CLEAR(clear_module_state->__pyx_n_s_msg);
  Py_CLEAR(clear_module_state->__pyx_kp_u_msg_msg);
  Py_CLEAR(clear_module_state->__pyx_kp_u_msg_trace_trace);
  Py_CLEAR(clear_module_state->__pyx_n_s_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_new_bulk);
  Py_CLEAR(clear_module_state->__pyx_n_s_new_key);
  Py_CLEAR(clear_module_state->__pyx_n_s_new_output);
  Py_CLEAR(clear_module_state->__pyx_n_b_nothing);
  Py_CLEAR(clear_module_state->__pyx_n_s_offset);
  Py_CLEAR(clear_module_state->__pyx_n_b_ok);
  Py_CLEAR(clear_module_state->__pyx_n_s_open);
  Py_CLEAR(clear_module_state->__pyx_kp_u_or_epoch);
  Py_CLEAR(clear_module_state->__pyx_kp_u_or_status);
  Py_CLEAR(clear_module_state->__pyx_n_s_order_by);
  Py_CLEAR(clear_module_state->__pyx_n_s_os);
  Py_CLEAR(clear_module_state->__pyx_n_s_output);
  Py_CLEAR(clear_module_state->__pyx_n_s_p);
  Py_CLEAR(clear_module_state->__pyx_n_s_params);
  Py_CLEAR(clear_module_state->__pyx_n_s_parent);
  Py_CLEAR(clear_module_state->__pyx_n_s_parent_statuses);
  Py_CLEAR(clear_module_state->__pyx_n_s_parents);
  Py_CLEAR(clear_module_state->__pyx_n_s_path);
  Py_CLEAR(clear_module_state->__pyx_n_s_payload);
  Py_CLEAR(clear_module_state->__pyx_n_s_pending);
  Py_CLEAR(clear_module_state->__pyx_n_s_pending_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_pendings);
  Py_CLEAR(clear_module_state->__pyx_n_s_persistqueue);
  Py_CLEAR(clear_module_state->__pyx_n_s_pipe_debug);
  Py_CLEAR(clear_module_state->__pyx_n_s_pipe_interpreter);
  Py_CLEAR(clear_module_state->__pyx_n_s_platform);
  Py_CLEAR(clear_module_state->__pyx_n_s_port);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_cancel);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_cancels);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_delete_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_done);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_dones);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_error);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_fetch_errors);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_get_rows);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_get_step_count);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_get_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_pending);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_pendings);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_repair);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_reset);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_reset_errors);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_resets);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_upload_step);
  Py_CLEAR(clear_module_state->__pyx_n_s_postgres_upload_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_prepare);
  Py_CLEAR(clear_module_state->__pyx_n_s_print);
  Py_CLEAR(clear_module_state->__pyx_n_s_print_exc);
  Py_CLEAR(clear_module_state->__pyx_n_s_priority);
  Py_CLEAR(clear_module_state->__pyx_kp_s_priority_ASC_epoch);
  Py_CLEAR(clear_module_state->__pyx_kp_s_priority_DESC_epoch);
  Py_CLEAR(clear_module_state->__pyx_kp_s_priority_asc_epoch);
  Py_CLEAR(clear_module_state->__pyx_kp_s_priority_desc_epoch);
  Py_CLEAR(clear_module_state->__pyx_n_s_process_request);
  Py_CLEAR(clear_module_state->__pyx_n_s_process_transactions);
  Py_CLEAR(clear_module_state->__pyx_n_s_processing);
  Py_CLEAR(clear_module_state->__pyx_n_s_psycopg2);
  Py_CLEAR(clear_module_state->__pyx_n_s_put);
  Py_CLEAR(clear_module_state->__pyx_n_s_q);
  Py_CLEAR(clear_module_state->__pyx_n_s_qs);
  Py_CLEAR(clear_module_state->__pyx_n_s_qsize);
  Py_CLEAR(clear_module_state->__pyx_n_s_qualname);
  Py_CLEAR(clear_module_state->__pyx_n_s_query);
  Py_CLEAR(clear_module_state->__pyx_n_s_query_string);
  Py_CLEAR(clear_module_state->__pyx_n_s_queue);
  Py_CLEAR(clear_module_state->__pyx_n_s_queued);
  Py_CLEAR(clear_module_state->__pyx_n_s_r);
  Py_CLEAR(clear_module_state->__pyx_n_s_range);
  Py_CLEAR(clear_module_state->__pyx_n_s_read);
  Py_CLEAR(clear_module_state->__pyx_n_s_receive);
  Py_CLEAR(clear_module_state->__pyx_n_s_received);
  Py_CLEAR(clear_module_state->__pyx_n_s_recv);
  Py_CLEAR(clear_module_state->__pyx_n_s_remove_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_remove_step);
  Py_CLEAR(clear_module_state->__pyx_n_s_repair);
  Py_CLEAR(clear_module_state->__pyx_n_s_request);
  Py_CLEAR(clear_module_state->__pyx_n_s_reset);
  Py_CLEAR(clear_module_state->__pyx_n_s_reset_2);
  Py_CLEAR(clear_module_state->__pyx_kp_b_reset_errors);
  Py_CLEAR(clear_module_state->__pyx_kp_s_reset_errors);
  Py_CLEAR(clear_module_state->__pyx_n_s_reset_errors_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_reset_errors_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_reset_tag_usage);
  Py_CLEAR(clear_module_state->__pyx_n_s_resets);
  Py_CLEAR(clear_module_state->__pyx_n_s_response);
  Py_CLEAR(clear_module_state->__pyx_n_s_result);
  Py_CLEAR(clear_module_state->__pyx_n_s_retries);
  Py_CLEAR(clear_module_state->__pyx_n_s_return);
  Py_CLEAR(clear_module_state->__pyx_n_s_return_job_def_id);
  Py_CLEAR(clear_module_state->__pyx_n_s_return_job_ids);
  Py_CLEAR(clear_module_state->__pyx_n_s_reverse);
  Py_CLEAR(clear_module_state->__pyx_n_s_row);
  Py_CLEAR(clear_module_state->__pyx_n_s_rows);
  Py_CLEAR(clear_module_state->__pyx_n_s_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_s_scope);
  Py_CLEAR(clear_module_state->__pyx_kp_u_s_scope_ANY_array);
  Py_CLEAR(clear_module_state->__pyx_n_s_scope);
  Py_CLEAR(clear_module_state->__pyx_n_s_scope_section);
  Py_CLEAR(clear_module_state->__pyx_n_s_scopes);
  Py_CLEAR(clear_module_state->__pyx_kp_u_seconds);
  Py_CLEAR(clear_module_state->__pyx_kp_u_select_buj_id_bsm_name_from_sel);
  Py_CLEAR(clear_module_state->__pyx_kp_u_select_count_as_amount_min_prior);
  Py_CLEAR(clear_module_state->__pyx_kp_s_select_from_buelon_jobs_where_st);
  Py_CLEAR(clear_module_state->__pyx_kp_s_select_id_attempts_from_bue_sess);
  Py_CLEAR(clear_module_state->__pyx_kp_u_select_id_status_from_buelon_job);
  Py_CLEAR(clear_module_state->__pyx_kp_u_select_max_priority_as_priority);
  Py_CLEAR(clear_module_state->__pyx_kp_u_select_status_count_as_amount_f);
  Py_CLEAR(clear_module_state->__pyx_kp_u_select_status_count_as_amount_f_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_self);
  Py_CLEAR(clear_module_state->__pyx_n_s_send);
  Py_CLEAR(clear_module_state->__pyx_n_s_send_request);
  Py_CLEAR(clear_module_state->__pyx_n_s_sendall);
  Py_CLEAR(clear_module_state->__pyx_n_s_server);
  Py_CLEAR(clear_module_state->__pyx_n_s_set);
  Py_CLEAR(clear_module_state->__pyx_kp_s_set_None);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_step);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_setdefaulttimeout);
  Py_CLEAR(clear_module_state->__pyx_n_s_setsockopt);
  Py_CLEAR(clear_module_state->__pyx_n_s_settimeout);
  Py_CLEAR(clear_module_state->__pyx_n_s_should_finish);
  Py_CLEAR(clear_module_state->__pyx_n_s_shutdown);
  Py_CLEAR(clear_module_state->__pyx_n_s_signal);
  Py_CLEAR(clear_module_state->__pyx_kp_s_signal_only_works_in_main_thread);
  Py_CLEAR(clear_module_state->__pyx_n_s_signum);
  Py_CLEAR(clear_module_state->__pyx_n_s_sleep);
  Py_CLEAR(clear_module_state->__pyx_n_s_socket);
  Py_CLEAR(clear_module_state->__pyx_kp_s_socket_socket);
  Py_CLEAR(clear_module_state->__pyx_n_s_spec);
  Py_CLEAR(clear_module_state->__pyx_n_s_split);
  Py_CLEAR(clear_module_state->__pyx_n_s_sql);
  Py_CLEAR(clear_module_state->__pyx_n_s_sql_set_to_working);
  Py_CLEAR(clear_module_state->__pyx_n_s_sql_update_children);
  Py_CLEAR(clear_module_state->__pyx_n_s_sql_update_step);
  Py_CLEAR(clear_module_state->__pyx_n_s_sqlite3);
  Py_CLEAR(clear_module_state->__pyx_n_s_ss);
  Py_CLEAR(clear_module_state->__pyx_n_s_start);
  Py_CLEAR(clear_module_state->__pyx_n_s_state);
  Py_CLEAR(clear_module_state->__pyx_kp_u_state_archived_WHERE);
  Py_CLEAR(clear_module_state->__pyx_kp_u_state_archived_WHERE_id);
  Py_CLEAR(clear_module_state->__pyx_kp_u_state_waiting_WHERE);
  Py_CLEAR(clear_module_state->__pyx_kp_u_state_waiting_WHERE_id);
  Py_CLEAR(clear_module_state->__pyx_n_s_status);
  Py_CLEAR(clear_module_state->__pyx_n_s_status_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_status_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_statuses);
  Py_CLEAR(clear_module_state->__pyx_n_s_stdout);
  Py_CLEAR(clear_module_state->__pyx_n_s_step);
  Py_CLEAR(clear_module_state->__pyx_n_s_step_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_step_3);
  Py_CLEAR(clear_module_state->__pyx_kp_b_step_count);
  Py_CLEAR(clear_module_state->__pyx_kp_s_step_count);
  Py_CLEAR(clear_module_state->__pyx_kp_u_step_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_step_id);
  Py_CLEAR(clear_module_state->__pyx_n_s_step_ids);
  Py_CLEAR(clear_module_state->__pyx_n_s_step_json);
  Py_CLEAR(clear_module_state->__pyx_n_s_step_jsons);
  Py_CLEAR(clear_module_state->__pyx_n_s_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_str);
  Py_CLEAR(clear_module_state->__pyx_kp_s_str_None);
  Py_CLEAR(clear_module_state->__pyx_kp_s_str_list_str_None);
  Py_CLEAR(clear_module_state->__pyx_kp_s_str_list_str_tuple_str_list_str);
  Py_CLEAR(clear_module_state->__pyx_n_s_string);
  Py_CLEAR(clear_module_state->__pyx_n_s_strip);
  Py_CLEAR(clear_module_state->__pyx_n_s_submit);
  Py_CLEAR(clear_module_state->__pyx_kp_u_submit_jobs);
  Py_CLEAR(clear_module_state->__pyx_n_s_submit_pipe_code);
  Py_CLEAR(clear_module_state->__pyx_n_s_submit_pipe_code_from_file);
  Py_CLEAR(clear_module_state->__pyx_n_s_success);
  Py_CLEAR(clear_module_state->__pyx_n_s_suffix);
  Py_CLEAR(clear_module_state->__pyx_n_s_super);
  Py_CLEAR(clear_module_state->__pyx_n_s_sync);
  Py_CLEAR(clear_module_state->__pyx_n_s_sys);
  Py_CLEAR(clear_module_state->__pyx_n_s_system);
  Py_CLEAR(clear_module_state->__pyx_n_s_table);
  Py_CLEAR(clear_module_state->__pyx_n_s_tag);
  Py_CLEAR(clear_module_state->__pyx_n_s_tag_lock);
  Py_CLEAR(clear_module_state->__pyx_n_s_tag_usage);
  Py_CLEAR(clear_module_state->__pyx_n_s_tag_velocities);
  Py_CLEAR(clear_module_state->__pyx_n_s_target);
  Py_CLEAR(clear_module_state->__pyx_n_s_task_done);
  Py_CLEAR(clear_module_state->__pyx_n_s_test);
  Py_CLEAR(clear_module_state->__pyx_n_s_thread);
  Py_CLEAR(clear_module_state->__pyx_n_s_threading);
  Py_CLEAR(clear_module_state->__pyx_n_s_throw);
  Py_CLEAR(clear_module_state->__pyx_n_s_time);
  Py_CLEAR(clear_module_state->__pyx_n_s_timeout);
  Py_CLEAR(clear_module_state->__pyx_n_s_timeout_duration);
  Py_CLEAR(clear_module_state->__pyx_n_s_timeout_func);
  Py_CLEAR(clear_module_state->__pyx_n_s_timeout_func_locals_CustomTimeou);
  Py_CLEAR(clear_module_state->__pyx_n_s_timeout_func_locals_handler);
  Py_CLEAR(clear_module_state->__pyx_n_s_to_json);
  Py_CLEAR(clear_module_state->__pyx_n_s_total);
  Py_CLEAR(clear_module_state->__pyx_n_s_tqdm);
  Py_CLEAR(clear_module_state->__pyx_n_s_trace);
  Py_CLEAR(clear_module_state->__pyx_kp_u_trace_state_waiting_WHERE_id);
  Py_CLEAR(clear_module_state->__pyx_n_s_traceback);
  Py_CLEAR(clear_module_state->__pyx_n_s_transaction_queue);
  Py_CLEAR(clear_module_state->__pyx_n_b_true);
  Py_CLEAR(clear_module_state->__pyx_n_s_true);
  Py_CLEAR(clear_module_state->__pyx_n_s_types);
  Py_CLEAR(clear_module_state->__pyx_n_s_typing);
  Py_CLEAR(clear_module_state->__pyx_n_s_unsync);
  Py_CLEAR(clear_module_state->__pyx_kp_u_update_bue_session_ids_set_attem);
  Py_CLEAR(clear_module_state->__pyx_kp_u_update_buelon_jobs_set_status);
  Py_CLEAR(clear_module_state->__pyx_n_s_update_params);
  Py_CLEAR(clear_module_state->__pyx_n_s_update_query);
  Py_CLEAR(clear_module_state->__pyx_kp_u_update_steps_set_status);
  Py_CLEAR(clear_module_state->__pyx_n_s_upload_pipe_code);
  Py_CLEAR(clear_module_state->__pyx_n_s_upload_pipe_code_from_file);
  Py_CLEAR(clear_module_state->__pyx_n_s_upload_pipe_code_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_kp_b_upload_step);
  Py_CLEAR(clear_module_state->__pyx_kp_s_upload_step);
  Py_CLEAR(clear_module_state->__pyx_n_s_upload_step_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_upload_step_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_upload_steps);
  Py_CLEAR(clear_module_state->__pyx_n_s_upload_steps_2);
  Py_CLEAR(clear_module_state->__pyx_kp_s_upload_steps_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_upload_table);
  Py_CLEAR(clear_module_state->__pyx_n_s_uuid);
  Py_CLEAR(clear_module_state->__pyx_n_s_uuid1);
  Py_CLEAR(clear_module_state->__pyx_n_s_v);
  Py_CLEAR(clear_module_state->__pyx_n_s_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_velocity);
  Py_CLEAR(clear_module_state->__pyx_n_s_velocity_sql);
  Py_CLEAR(clear_module_state->__pyx_n_s_wait_until_finish);
  Py_CLEAR(clear_module_state->__pyx_n_s_waiting);
  Py_CLEAR(clear_module_state->__pyx_n_s_waiting_priority);
  Py_CLEAR(clear_module_state->__pyx_n_s_warn);
  Py_CLEAR(clear_module_state->__pyx_n_s_warnings);
  Py_CLEAR(clear_module_state->__pyx_n_s_where);
  Py_CLEAR(clear_module_state->__pyx_kp_u_where_status);
  Py_CLEAR(clear_module_state->__pyx_kp_u_where_status_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_where_status_not_in);
  Py_CLEAR(clear_module_state->__pyx_kp_u_where_status_not_in_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_worker);
  Py_CLEAR(clear_module_state->__pyx_n_s_worker_thread);
  Py_CLEAR(clear_module_state->__pyx_n_s_working);
  Py_CLEAR(clear_module_state->__pyx_n_s_working_clause);
  Py_CLEAR(clear_module_state->__pyx_n_s_write);
  Py_CLEAR(clear_module_state->__pyx_n_s_zip);
  Py_CLEAR(clear_module_state->__pyx_float_5_);
  Py_CLEAR(clear_module_state->__pyx_float_10_);
  Py_CLEAR(clear_module_state->__pyx_int_0);
  Py_CLEAR(clear_module_state->__pyx_int_1);
  Py_CLEAR(clear_module_state->__pyx_int_2);
  Py_CLEAR(clear_module_state->__pyx_int_3);
  Py_CLEAR(clear_module_state->__pyx_int_4);
  Py_CLEAR(clear_module_state->__pyx_int_5);
  Py_CLEAR(clear_module_state->__pyx_int_10);
  Py_CLEAR(clear_module_state->__pyx_int_30);
  Py_CLEAR(clear_module_state->__pyx_int_50);
  Py_CLEAR(clear_module_state->__pyx_int_60);
  Py_CLEAR(clear_module_state->__pyx_int_100);
  Py_CLEAR(clear_module_state->__pyx_int_600);
  Py_CLEAR(clear_module_state->__pyx_int_1000);
  Py_CLEAR(clear_module_state->__pyx_int_1024);
  Py_CLEAR(clear_module_state->__pyx_int_2000);
  Py_CLEAR(clear_module_state->__pyx_int_65432);
  Py_CLEAR(clear_module_state->__pyx_tuple_);
  Py_CLEAR(clear_module_state->__pyx_tuple__5);
  Py_CLEAR(clear_module_state->__pyx_tuple__6);
  Py_CLEAR(clear_module_state->__pyx_tuple__7);
  Py_CLEAR(clear_module_state->__pyx_tuple__17);
  Py_CLEAR(clear_module_state->__pyx_tuple__18);
  Py_CLEAR(clear_module_state->__pyx_tuple__19);
  Py_CLEAR(clear_module_state->__pyx_tuple__25);
  Py_CLEAR(clear_module_state->__pyx_tuple__26);
  Py_CLEAR(clear_module_state->__pyx_tuple__27);
  Py_CLEAR(clear_module_state->__pyx_tuple__28);
  Py_CLEAR(clear_module_state->__pyx_tuple__36);
  Py_CLEAR(clear_module_state->__pyx_tuple__37);
  Py_CLEAR(clear_module_state->__pyx_tuple__40);
  Py_CLEAR(clear_module_state->__pyx_tuple__41);
  Py_CLEAR(clear_module_state->__pyx_tuple__43);
  Py_CLEAR(clear_module_state->__pyx_tuple__46);
  Py_CLEAR(clear_module_state->__pyx_tuple__52);
  Py_CLEAR(clear_module_state->__pyx_tuple__53);
  Py_CLEAR(clear_module_state->__pyx_tuple__55);
  Py_CLEAR(clear_module_state->__pyx_tuple__57);
  Py_CLEAR(clear_module_state->__pyx_tuple__58);
  Py_CLEAR(clear_module_state->__pyx_tuple__59);
  Py_CLEAR(clear_module_state->__pyx_tuple__60);
  Py_CLEAR(clear_module_state->__pyx_tuple__61);
  Py_CLEAR(clear_module_state->__pyx_tuple__62);
  Py_CLEAR(clear_module_state->__pyx_tuple__63);
  Py_CLEAR(clear_module_state->__pyx_tuple__64);
  Py_CLEAR(clear_module_state->__pyx_tuple__65);
  Py_CLEAR(clear_module_state->__pyx_tuple__66);
  Py_CLEAR(clear_module_state->__pyx_tuple__67);
  Py_CLEAR(clear_module_state->__pyx_tuple__71);
  Py_CLEAR(clear_module_state->__pyx_tuple__73);
  Py_CLEAR(clear_module_state->__pyx_tuple__74);
  Py_CLEAR(clear_module_state->__pyx_tuple__76);
  Py_CLEAR(clear_module_state->__pyx_tuple__78);
  Py_CLEAR(clear_module_state->__pyx_tuple__80);
  Py_CLEAR(clear_module_state->__pyx_tuple__82);
  Py_CLEAR(clear_module_state->__pyx_tuple__84);
  Py_CLEAR(clear_module_state->__pyx_tuple__86);
  Py_CLEAR(clear_module_state->__pyx_tuple__87);
  Py_CLEAR(clear_module_state->__pyx_tuple__89);
  Py_CLEAR(clear_module_state->__pyx_tuple__90);
  Py_CLEAR(clear_module_state->__pyx_tuple__92);
  Py_CLEAR(clear_module_state->__pyx_tuple__93);
  Py_CLEAR(clear_module_state->__pyx_tuple__95);
  Py_CLEAR(clear_module_state->__pyx_tuple__97);
  Py_CLEAR(clear_module_state->__pyx_tuple__99);
  Py_CLEAR(clear_module_state->__pyx_codeobj__2);
  Py_CLEAR(clear_module_state->__pyx_tuple__101);
  Py_CLEAR(clear_module_state->__pyx_tuple__103);
  Py_CLEAR(clear_module_state->__pyx_tuple__104);
  Py_CLEAR(clear_module_state->__pyx_tuple__106);
  Py_CLEAR(clear_module_state->__pyx_tuple__107);
  Py_CLEAR(clear_module_state->__pyx_tuple__109);
  Py_CLEAR(clear_module_state->__pyx_tuple__111);
  Py_CLEAR(clear_module_state->__pyx_tuple__113);
  Py_CLEAR(clear_module_state->__pyx_tuple__115);
  Py_CLEAR(clear_module_state->__pyx_tuple__117);
  Py_CLEAR(clear_module_state->__pyx_tuple__119);
  Py_CLEAR(clear_module_state->__pyx_tuple__121);
  Py_CLEAR(clear_module_state->__pyx_tuple__123);
  Py_CLEAR(clear_module_state->__pyx_tuple__125);
  Py_CLEAR(clear_module_state->__pyx_tuple__127);
  Py_CLEAR(clear_module_state->__pyx_tuple__129);
  Py_CLEAR(clear_module_state->__pyx_tuple__131);
  Py_CLEAR(clear_module_state->__pyx_tuple__133);
  Py_CLEAR(clear_module_state->__pyx_tuple__134);
  Py_CLEAR(clear_module_state->__pyx_tuple__136);
  Py_CLEAR(clear_module_state->__pyx_tuple__138);
  Py_CLEAR(clear_module_state->__pyx_tuple__140);
  Py_CLEAR(clear_module_state->__pyx_tuple__142);
  Py_CLEAR(clear_module_state->__pyx_tuple__144);
  Py_CLEAR(clear_module_state->__pyx_tuple__146);
  Py_CLEAR(clear_module_state->__pyx_tuple__148);
  Py_CLEAR(clear_module_state->__pyx_tuple__150);
  Py_CLEAR(clear_module_state->__pyx_tuple__152);
  Py_CLEAR(clear_module_state->__pyx_tuple__155);
  Py_CLEAR(clear_module_state->__pyx_tuple__157);
  Py_CLEAR(clear_module_state->__pyx_tuple__159);
  Py_CLEAR(clear_module_state->__pyx_tuple__161);
  Py_CLEAR(clear_module_state->__pyx_tuple__166);
  Py_CLEAR(clear_module_state->__pyx_tuple__168);
  Py_CLEAR(clear_module_state->__pyx_tuple__169);
  Py_CLEAR(clear_module_state->__pyx_tuple__171);
  Py_CLEAR(clear_module_state->__pyx_tuple__172);
  Py_CLEAR(clear_module_state->__pyx_tuple__174);
  Py_CLEAR(clear_module_state->__pyx_tuple__175);
  Py_CLEAR(clear_module_state->__pyx_tuple__177);
  Py_CLEAR(clear_module_state->__pyx_tuple__179);
  Py_CLEAR(clear_module_state->__pyx_tuple__181);
  Py_CLEAR(clear_module_state->__pyx_tuple__183);
  Py_CLEAR(clear_module_state->__pyx_tuple__185);
  Py_CLEAR(clear_module_state->__pyx_tuple__187);
  Py_CLEAR(clear_module_state->__pyx_tuple__189);
  Py_CLEAR(clear_module_state->__pyx_tuple__191);
  Py_CLEAR(clear_module_state->__pyx_tuple__193);
  Py_CLEAR(clear_module_state->__pyx_tuple__197);
  Py_CLEAR(clear_module_state->__pyx_tuple__199);
  Py_CLEAR(clear_module_state->__pyx_tuple__201);
  Py_CLEAR(clear_module_state->__pyx_tuple__204);
  Py_CLEAR(clear_module_state->__pyx_tuple__212);
  Py_CLEAR(clear_module_state->__pyx_tuple__214);
  Py_CLEAR(clear_module_state->__pyx_tuple__216);
  Py_CLEAR(clear_module_state->__pyx_tuple__218);
  Py_CLEAR(clear_module_state->__pyx_tuple__220);
  Py_CLEAR(clear_module_state->__pyx_tuple__223);
  Py_CLEAR(clear_module_state->__pyx_tuple__225);
  Py_CLEAR(clear_module_state->__pyx_tuple__227);
  Py_CLEAR(clear_module_state->__pyx_tuple__229);
  Py_CLEAR(clear_module_state->__pyx_tuple__231);
  Py_CLEAR(clear_module_state->__pyx_tuple__233);
  Py_CLEAR(clear_module_state->__pyx_tuple__235);
  Py_CLEAR(clear_module_state->__pyx_tuple__237);
  Py_CLEAR(clear_module_state->__pyx_tuple__239);
  Py_CLEAR(clear_module_state->__pyx_tuple__241);
  Py_CLEAR(clear_module_state->__pyx_tuple__243);
  Py_CLEAR(clear_module_state->__pyx_tuple__245);
  Py_CLEAR(clear_module_state->__pyx_tuple__247);
  Py_CLEAR(clear_module_state->__pyx_tuple__249);
  Py_CLEAR(clear_module_state->__pyx_tuple__252);
  Py_CLEAR(clear_module_state->__pyx_tuple__254);
  Py_CLEAR(clear_module_state->__pyx_tuple__256);
  Py_CLEAR(clear_module_state->__pyx_tuple__258);
  Py_CLEAR(clear_module_state->__pyx_tuple__260);
  Py_CLEAR(clear_module_state->__pyx_tuple__262);
  Py_CLEAR(clear_module_state->__pyx_tuple__265);
  Py_CLEAR(clear_module_state->__pyx_codeobj__29);
  Py_CLEAR(clear_module_state->__pyx_codeobj__38);
  Py_CLEAR(clear_module_state->__pyx_codeobj__47);
  Py_CLEAR(clear_module_state->__pyx_codeobj__51);
  Py_CLEAR(clear_module_state->__pyx_codeobj__54);
  Py_CLEAR(clear_module_state->__pyx_codeobj__56);
  Py_CLEAR(clear_module_state->__pyx_codeobj__70);
  Py_CLEAR(clear_module_state->__pyx_codeobj__72);
  Py_CLEAR(clear_module_state->__pyx_codeobj__75);
  Py_CLEAR(clear_module_state->__pyx_codeobj__77);
  Py_CLEAR(clear_module_state->__pyx_codeobj__79);
  Py_CLEAR(clear_module_state->__pyx_codeobj__81);
  Py_CLEAR(clear_module_state->__pyx_codeobj__83);
  Py_CLEAR(clear_module_state->__pyx_codeobj__85);
  Py_CLEAR(clear_module_state->__pyx_codeobj__88);
  Py_CLEAR(clear_module_state->__pyx_codeobj__91);
  Py_CLEAR(clear_module_state->__pyx_codeobj__94);
  Py_CLEAR(clear_module_state->__pyx_codeobj__96);
  Py_CLEAR(clear_module_state->__pyx_codeobj__98);
  Py_CLEAR(clear_module_state->__pyx_codeobj__100);
  Py_CLEAR(clear_module_state->__pyx_codeobj__102);
  Py_CLEAR(clear_module_state->__pyx_codeobj__105);
  Py_CLEAR(clear_module_state->__pyx_codeobj__108);
  Py_CLEAR(clear_module_state->__pyx_codeobj__110);
  Py_CLEAR(clear_module_state->__pyx_codeobj__112);
  Py_CLEAR(clear_module_state->__pyx_codeobj__114);
  Py_CLEAR(clear_module_state->__pyx_codeobj__116);
  Py_CLEAR(clear_module_state->__pyx_codeobj__118);
  Py_CLEAR(clear_module_state->__pyx_codeobj__120);
  Py_CLEAR(clear_module_state->__pyx_codeobj__122);
  Py_CLEAR(clear_module_state->__pyx_codeobj__124);
  Py_CLEAR(clear_module_state->__pyx_codeobj__126);
  Py_CLEAR(clear_module_state->__pyx_codeobj__128);
  Py_CLEAR(clear_module_state->__pyx_codeobj__130);
  Py_CLEAR(clear_module_state->__pyx_codeobj__132);
  Py_CLEAR(clear_module_state->__pyx_codeobj__135);
  Py_CLEAR(clear_module_state->__pyx_codeobj__137);
  Py_CLEAR(clear_module_state->__pyx_codeobj__139);
  Py_CLEAR(clear_module_state->__pyx_codeobj__141);
  Py_CLEAR(clear_module_state->__pyx_codeobj__143);
  Py_CLEAR(clear_module_state->__pyx_codeobj__145);
  Py_CLEAR(clear_module_state->__pyx_codeobj__147);
  Py_CLEAR(clear_module_state->__pyx_codeobj__149);
  Py_CLEAR(clear_module_state->__pyx_codeobj__151);
  Py_CLEAR(clear_module_state->__pyx_codeobj__153);
  Py_CLEAR(clear_module_state->__pyx_codeobj__154);
  Py_CLEAR(clear_module_state->__pyx_codeobj__156);
  Py_CLEAR(clear_module_state->__pyx_codeobj__158);
  Py_CLEAR(clear_module_state->__pyx_codeobj__160);
  Py_CLEAR(clear_module_state->__pyx_codeobj__162);
  Py_CLEAR(clear_module_state->__pyx_codeobj__163);
  Py_CLEAR(clear_module_state->__pyx_codeobj__164);
  Py_CLEAR(clear_module_state->__pyx_codeobj__165);
  Py_CLEAR(clear_module_state->__pyx_codeobj__167);
  Py_CLEAR(clear_module_state->__pyx_codeobj__170);
  Py_CLEAR(clear_module_state->__pyx_codeobj__173);
  Py_CLEAR(clear_module_state->__pyx_codeobj__176);
  Py_CLEAR(clear_module_state->__pyx_codeobj__178);
  Py_CLEAR(clear_module_state->__pyx_codeobj__180);
  Py_CLEAR(clear_module_state->__pyx_codeobj__182);
  Py_CLEAR(clear_module_state->__pyx_codeobj__184);
  Py_CLEAR(clear_module_state->__pyx_codeobj__186);
  Py_CLEAR(clear_module_state->__pyx_codeobj__188);
  Py_CLEAR(clear_module_state->__pyx_codeobj__190);
  Py_CLEAR(clear_module_state->__pyx_codeobj__192);
  Py_CLEAR(clear_module_state->__pyx_codeobj__194);
  Py_CLEAR(clear_module_state->__pyx_codeobj__195);
  Py_CLEAR(clear_module_state->__pyx_codeobj__196);
  Py_CLEAR(clear_module_state->__pyx_codeobj__198);
  Py_CLEAR(clear_module_state->__pyx_codeobj__200);
  Py_CLEAR(clear_module_state->__pyx_codeobj__202);
  Py_CLEAR(clear_module_state->__pyx_codeobj__203);
  Py_CLEAR(clear_module_state->__pyx_codeobj__205);
  Py_CLEAR(clear_module_state->__pyx_codeobj__206);
  Py_CLEAR(clear_module_state->__pyx_codeobj__207);
  Py_CLEAR(clear_module_state->__pyx_codeobj__208);
  Py_CLEAR(clear_module_state->__pyx_codeobj__209);
  Py_CLEAR(clear_module_state->__pyx_codeobj__210);
  Py_CLEAR(clear_module_state->__pyx_codeobj__211);
  Py_CLEAR(clear_module_state->__pyx_codeobj__213);
  Py_CLEAR(clear_module_state->__pyx_codeobj__215);
  Py_CLEAR(clear_module_state->__pyx_codeobj__217);
  Py_CLEAR(clear_module_state->__pyx_codeobj__219);
  Py_CLEAR(clear_module_state->__pyx_codeobj__221);
  Py_CLEAR(clear_module_state->__pyx_codeobj__222);
  Py_CLEAR(clear_module_state->__pyx_codeobj__224);
  Py_CLEAR(clear_module_state->__pyx_codeobj__226);
  Py_CLEAR(clear_module_state->__pyx_codeobj__228);
  Py_CLEAR(clear_module_state->__pyx_codeobj__230);
  Py_CLEAR(clear_module_state->__pyx_codeobj__232);
  Py_CLEAR(clear_module_state->__pyx_codeobj__234);
  Py_CLEAR(clear_module_state->__pyx_codeobj__236);
  Py_CLEAR(clear_module_state->__pyx_codeobj__238);
  Py_CLEAR(clear_module_state->__pyx_codeobj__240);
  Py_CLEAR(clear_module_state->__pyx_codeobj__242);
  Py_CLEAR(clear_module_state->__pyx_codeobj__244);
  Py_CLEAR(clear_module_state->__pyx_codeobj__246);
  Py_CLEAR(clear_module_state->__pyx_codeobj__248);
  Py_CLEAR(clear_module_state->__pyx_codeobj__250);
  Py_CLEAR(clear_module_state->__pyx_codeobj__251);
  Py_CLEAR(clear_module_state->__pyx_codeobj__253);
  Py_CLEAR(clear_module_state->__pyx_codeobj__255);
  Py_CLEAR(clear_module_state->__pyx_codeobj__257);
  Py_CLEAR(clear_module_state->__pyx_codeobj__259);
  Py_CLEAR(clear_module_state->__pyx_codeobj__261);
  Py_CLEAR(clear_module_state->__pyx_codeobj__263);
  Py_CLEAR(clear_module_state->__pyx_codeobj__264);
  Py_CLEAR(clear_module_state->__pyx_codeobj__266);
  return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstate *traverse_module_state = __pyx_mstate(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  Py_VISIT(traverse_module_state->__pyx_empty_tuple);
  Py_VISIT(traverse_module_state->__pyx_empty_bytes);
  Py_VISIT(traverse_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
  #endif
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair);
  Py_VISIT(traverse_module_state->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr);
  Py_VISIT(traverse_module_state->__pyx_kp_u_0);
  Py_VISIT(traverse_module_state->__pyx_kp_s_0_0_0_0);
  Py_VISIT(traverse_module_state->__pyx_n_s_AF_INET);
  Py_VISIT(traverse_module_state->__pyx_kp_s_AND_not);
  Py_VISIT(traverse_module_state->__pyx_kp_u_AND_not_lower_msg_like);
  Py_VISIT(traverse_module_state->__pyx_kp_u_AND_s_status);
  Py_VISIT(traverse_module_state->__pyx_kp_u_AND_s_status_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_AND_s_status_3);
  Py_VISIT(traverse_module_state->__pyx_kp_u_AND_status);
  Py_VISIT(traverse_module_state->__pyx_kp_u_AND_status_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_Any);
  Py_VISIT(traverse_module_state->__pyx_n_s_AttributeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_CANCEL);
  Py_VISIT(traverse_module_state->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s);
  Py_VISIT(traverse_module_state->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_2);
  Py_VISIT(traverse_module_state->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_3);
  Py_VISIT(traverse_module_state->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_4);
  Py_VISIT(traverse_module_state->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_5);
  Py_VISIT(traverse_module_state->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_6);
  Py_VISIT(traverse_module_state->__pyx_kp_s_CREATE_INDEX_if_not_exists_idx_b);
  Py_VISIT(traverse_module_state->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo);
  Py_VISIT(traverse_module_state->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_2);
  Py_VISIT(traverse_module_state->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_3);
  Py_VISIT(traverse_module_state->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_steps);
  Py_VISIT(traverse_module_state->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags);
  Py_VISIT(traverse_module_state->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags_2);
  Py_VISIT(traverse_module_state->__pyx_kp_s_CREATE_UNIQUE_INDEX_IF_NOT_EXIST);
  Py_VISIT(traverse_module_state->__pyx_n_s_Callable);
  Py_VISIT(traverse_module_state->__pyx_n_s_Client);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConnectionRefusedError);
  Py_VISIT(traverse_module_state->__pyx_n_s_CustomTimeoutError);
  Py_VISIT(traverse_module_state->__pyx_n_s_DEFAULT_SCOPES);
  Py_VISIT(traverse_module_state->__pyx_n_s_DELETE_STEPS);
  Py_VISIT(traverse_module_state->__pyx_n_s_DONE);
  Py_VISIT(traverse_module_state->__pyx_n_s_Done);
  Py_VISIT(traverse_module_state->__pyx_n_s_ERROR);
  Py_VISIT(traverse_module_state->__pyx_n_s_Enum);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Error);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Error_processing_transaction);
  Py_VISIT(traverse_module_state->__pyx_kp_s_F);
  Py_VISIT(traverse_module_state->__pyx_n_s_FETCH_ERRORS);
  Py_VISIT(traverse_module_state->__pyx_n_s_FETCH_ROWS);
  Py_VISIT(traverse_module_state->__pyx_kp_u_FOR_UPDATE_SKIP_LOCKED);
  Py_VISIT(traverse_module_state->__pyx_kp_u_FOR_UPDATE_SKIP_LOCKED_RETURNIN);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Fetching_data_for_jobs_by_1_000);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Fetching_parents_of_jobs_by_1_00);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Fetching_queued_not_finished_job);
  Py_VISIT(traverse_module_state->__pyx_n_s_GET_STEPS);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient___enter);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient___exit);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient___getattr);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient___init);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient__already);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_cancel);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_cancels);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_close);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_connect);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_delete_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_done);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_dones);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_error);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_fetch_errors);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_get_rows);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_get_step_count);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_get_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_load_pg);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_pending);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_pendings);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_cancel);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_cancels);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_cancels_local);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_delete_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_done);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_done_locals_g);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_dones);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_dones_locals);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_error);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_fetch_errors);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_fetch_errors_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_fetch_errors_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_fetch_errors_4);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_get_rows);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_get_step_coun);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_get_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_get_steps_loc);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_get_steps_loc_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_pending);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_pendings);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_pendings_loca);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_repair);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_repair_locals);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_repair_locals_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_repair_locals_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_reset);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_reset_errors);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_resets);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_resets_locals);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_upload_step);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_postgres_upload_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_repair);
  Py_VISIT(traverse_module_state->__pyx_kp_s_HubClient_repair_is_only_impleme);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_reset);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_reset_errors);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_resets);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_send_request);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_upload_step);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubClient_upload_steps);
  Py_VISIT(traverse_module_state->__pyx_kp_s_HubClient_used_outside_the_main);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubServer);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubServer___init);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubServer__execute_request);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubServer__execute_transaction);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubServer__handle_client);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubServer__process_request);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubServer__process_request_local);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubServer__process_transactions);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubServer_create_db_pool);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubServer_execute_db_query);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubServer_execute_db_query_local);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubServer_get_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubServer_get_steps_locals_genex);
  Py_VISIT(traverse_module_state->__pyx_n_s_HubServer_start);
  Py_VISIT(traverse_module_state->__pyx_kp_s_INSERT_INTO_buelon_jobs_waiting);
  Py_VISIT(traverse_module_state->__pyx_kp_s_INSERT_INTO_steps_id_priority_sc);
  Py_VISIT(traverse_module_state->__pyx_n_s_IPPROTO_TCP);
  Py_VISIT(traverse_module_state->__pyx_n_s_InsufficientPrivilege);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Insufficient_privileges_to_creat);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_method);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_value_received);
  Py_VISIT(traverse_module_state->__pyx_kp_s_K);
  Py_VISIT(traverse_module_state->__pyx_n_s_KeyboardInterrupt);
  Py_VISIT(traverse_module_state->__pyx_n_s_LENGTH_OF_PIPELINE_END_TOKEN);
  Py_VISIT(traverse_module_state->__pyx_kp_u_LIMIT);
  Py_VISIT(traverse_module_state->__pyx_kp_u_LIMIT_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_LIMIT_3);
  Py_VISIT(traverse_module_state->__pyx_kp_u_LIMIT_4);
  Py_VISIT(traverse_module_state->__pyx_kp_u_LIMIT_5);
  Py_VISIT(traverse_module_state->__pyx_kp_u_LIMIT_OFFSET);
  Py_VISIT(traverse_module_state->__pyx_n_s_Lock);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Max_errors_met);
  Py_VISIT(traverse_module_state->__pyx_n_s_Method);
  Py_VISIT(traverse_module_state->__pyx_n_s_ModuleNotFoundError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_No_data_found_for_step);
  Py_VISIT(traverse_module_state->__pyx_n_s_None);
  Py_VISIT(traverse_module_state->__pyx_kp_u_None);
  Py_VISIT(traverse_module_state->__pyx_kp_s_OR);
  Py_VISIT(traverse_module_state->__pyx_kp_u_ORDER_BY);
  Py_VISIT(traverse_module_state->__pyx_kp_u_ORDER_BY_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_ORDER_BY_3);
  Py_VISIT(traverse_module_state->__pyx_kp_u_ORDER_BY_4);
  Py_VISIT(traverse_module_state->__pyx_kp_u_OR_epoch_coalesce_timeout);
  Py_VISIT(traverse_module_state->__pyx_kp_u_OR_lower_trace_like);
  Py_VISIT(traverse_module_state->__pyx_n_s_OSError);
  Py_VISIT(traverse_module_state->__pyx_n_s_PENDING);
  Py_VISIT(traverse_module_state->__pyx_n_s_PIPELINE_END_TOKEN);
  Py_VISIT(traverse_module_state->__pyx_n_s_PIPELINE_HOST);
  Py_VISIT(traverse_module_state->__pyx_n_s_PIPELINE_PORT);
  Py_VISIT(traverse_module_state->__pyx_n_s_PIPELINE_SPLIT_TOKEN);
  Py_VISIT(traverse_module_state->__pyx_n_s_PIPE_WORKER_HOST);
  Py_VISIT(traverse_module_state->__pyx_n_s_PIPE_WORKER_PORT);
  Py_VISIT(traverse_module_state->__pyx_kp_s_PRAGMA_journal_mode_WAL);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Port);
  Py_VISIT(traverse_module_state->__pyx_n_s_Queue);
  Py_VISIT(traverse_module_state->__pyx_n_s_RESET);
  Py_VISIT(traverse_module_state->__pyx_n_s_RESET_ERRORS);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Repairing_Steps_Commits_every_1);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Request_timed_out_after);
  Py_VISIT(traverse_module_state->__pyx_kp_u_SELECT_COUNT_FROM_buelon_jobs_WH);
  Py_VISIT(traverse_module_state->__pyx_kp_u_SELECT_COUNT_FROM_steps_WHERE_st);
  Py_VISIT(traverse_module_state->__pyx_kp_u_SELECT_FROM_buelon_jobs_WHERE_id);
  Py_VISIT(traverse_module_state->__pyx_kp_u_SELECT_FROM_steps_WHERE_id);
  Py_VISIT(traverse_module_state->__pyx_kp_u_SELECT_id_msg_trace_FROM_buelon);
  Py_VISIT(traverse_module_state->__pyx_kp_u_SELECT_id_msg_trace_FROM_steps_W);
  Py_VISIT(traverse_module_state->__pyx_kp_u_SELECT_id_priority_scope_velocit);
  Py_VISIT(traverse_module_state->__pyx_kp_u_SELECT_s_id_s_id_s_priority_s_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_SELECT_status_FROM_steps_WHERE_i);
  Py_VISIT(traverse_module_state->__pyx_kp_s_SELECT_tag_velocity_FROM_tags);
  Py_VISIT(traverse_module_state->__pyx_n_s_SHUT_RDWR);
  Py_VISIT(traverse_module_state->__pyx_n_s_SIGALRM);
  Py_VISIT(traverse_module_state->__pyx_n_s_SOCK_STREAM);
  Py_VISIT(traverse_module_state->__pyx_n_s_SQLiteQueue);
  Py_VISIT(traverse_module_state->__pyx_n_s_STEP_COUNT);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Server_listening_on);
  Py_VISIT(traverse_module_state->__pyx_n_s_Step);
  Py_VISIT(traverse_module_state->__pyx_n_s_StepStatus);
  Py_VISIT(traverse_module_state->__pyx_kp_s_TAB_scope_scope_priority_priorit);
  Py_VISIT(traverse_module_state->__pyx_n_s_TCP_NODELAY);
  Py_VISIT(traverse_module_state->__pyx_n_s_Thread);
  Py_VISIT(traverse_module_state->__pyx_n_s_ThreadPoolExecutor);
  Py_VISIT(traverse_module_state->__pyx_n_s_ThreadSafeSQLiteQueue);
  Py_VISIT(traverse_module_state->__pyx_n_s_ThreadSafeSQLiteQueue___init);
  Py_VISIT(traverse_module_state->__pyx_n_s_ThreadSafeSQLiteQueue__get_queue);
  Py_VISIT(traverse_module_state->__pyx_n_s_ThreadSafeSQLiteQueue_get);
  Py_VISIT(traverse_module_state->__pyx_n_s_ThreadSafeSQLiteQueue_put);
  Py_VISIT(traverse_module_state->__pyx_n_s_ThreadSafeSQLiteQueue_qsize);
  Py_VISIT(traverse_module_state->__pyx_n_s_ThreadSafeSQLiteQueue_task_done);
  Py_VISIT(traverse_module_state->__pyx_n_s_TimeoutError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  Py_VISIT(traverse_module_state->__pyx_kp_u_UPDATE_buelon_jobs_s_SET_state);
  Py_VISIT(traverse_module_state->__pyx_kp_u_UPDATE_steps_SET_status);
  Py_VISIT(traverse_module_state->__pyx_kp_u_UPDATE_steps_SET_status_epoch_W);
  Py_VISIT(traverse_module_state->__pyx_n_s_UPLOAD_STEP);
  Py_VISIT(traverse_module_state->__pyx_n_s_UPLOAD_STEPS);
  Py_VISIT(traverse_module_state->__pyx_n_s_USING_POSTGRES);
  Py_VISIT(traverse_module_state->__pyx_n_s_USING_POSTGRES_HUB);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Uploading_Jobs);
  Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_WHEN_THEN);
  Py_VISIT(traverse_module_state->__pyx_kp_u_WHERE_id_IN);
  Py_VISIT(traverse_module_state->__pyx_kp_u_WHERE_s_id_IN_SELECT_s_id_FROM);
  Py_VISIT(traverse_module_state->__pyx_kp_u_WITH_updated_jobs_AS_UPDATE_bue);
  Py_VISIT(traverse_module_state->__pyx_n_s_WORKER_HOST);
  Py_VISIT(traverse_module_state->__pyx_n_s_WORKER_PORT);
  Py_VISIT(traverse_module_state->__pyx_n_s_Windows);
  Py_VISIT(traverse_module_state->__pyx_kp_s__10);
  Py_VISIT(traverse_module_state->__pyx_kp_u__10);
  Py_VISIT(traverse_module_state->__pyx_kp_s__11);
  Py_VISIT(traverse_module_state->__pyx_kp_u__12);
  Py_VISIT(traverse_module_state->__pyx_kp_u__13);
  Py_VISIT(traverse_module_state->__pyx_kp_s__14);
  Py_VISIT(traverse_module_state->__pyx_kp_u__14);
  Py_VISIT(traverse_module_state->__pyx_kp_s__15);
  Py_VISIT(traverse_module_state->__pyx_kp_u__16);
  Py_VISIT(traverse_module_state->__pyx_kp_s__20);
  Py_VISIT(traverse_module_state->__pyx_kp_s__21);
  Py_VISIT(traverse_module_state->__pyx_kp_s__22);
  Py_VISIT(traverse_module_state->__pyx_kp_s__23);
  Py_VISIT(traverse_module_state->__pyx_kp_u__23);
  Py_VISIT(traverse_module_state->__pyx_kp_u__24);
  Py_VISIT(traverse_module_state->__pyx_kp_b__3);
  Py_VISIT(traverse_module_state->__pyx_kp_s__3);
  Py_VISIT(traverse_module_state->__pyx_kp_u__30);
  Py_VISIT(traverse_module_state->__pyx_kp_u__31);
  Py_VISIT(traverse_module_state->__pyx_kp_s__32);
  Py_VISIT(traverse_module_state->__pyx_kp_s__33);
  Py_VISIT(traverse_module_state->__pyx_kp_u__34);
  Py_VISIT(traverse_module_state->__pyx_kp_u__35);
  Py_VISIT(traverse_module_state->__pyx_kp_u__39);
  Py_VISIT(traverse_module_state->__pyx_kp_u__4);
  Py_VISIT(traverse_module_state->__pyx_kp_u__42);
  Py_VISIT(traverse_module_state->__pyx_kp_u__44);
  Py_VISIT(traverse_module_state->__pyx_kp_u__45);
  Py_VISIT(traverse_module_state->__pyx_kp_u__48);
  Py_VISIT(traverse_module_state->__pyx_kp_u__49);
  Py_VISIT(traverse_module_state->__pyx_kp_u__50);
  Py_VISIT(traverse_module_state->__pyx_kp_b__68);
  Py_VISIT(traverse_module_state->__pyx_kp_b__69);
  Py_VISIT(traverse_module_state->__pyx_kp_u__8);
  Py_VISIT(traverse_module_state->__pyx_kp_u__9);
  Py_VISIT(traverse_module_state->__pyx_kp_s_abcdefghijklmnopqrstuvwxyzABCDE);
  Py_VISIT(traverse_module_state->__pyx_n_s_accept);
  Py_VISIT(traverse_module_state->__pyx_n_s_active);
  Py_VISIT(traverse_module_state->__pyx_n_s_add);
  Py_VISIT(traverse_module_state->__pyx_n_s_addr);
  Py_VISIT(traverse_module_state->__pyx_n_s_alarm);
  Py_VISIT(traverse_module_state->__pyx_n_s_all);
  Py_VISIT(traverse_module_state->__pyx_n_s_allow_chars);
  Py_VISIT(traverse_module_state->__pyx_n_s_already);
  Py_VISIT(traverse_module_state->__pyx_n_s_already_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_amount);
  Py_VISIT(traverse_module_state->__pyx_kp_u_and_status);
  Py_VISIT(traverse_module_state->__pyx_n_s_append);
  Py_VISIT(traverse_module_state->__pyx_n_s_args);
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio);
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_tasks);
  Py_VISIT(traverse_module_state->__pyx_n_s_attempt);
  Py_VISIT(traverse_module_state->__pyx_n_s_attempts);
  Py_VISIT(traverse_module_state->__pyx_n_s_auto_commit);
  Py_VISIT(traverse_module_state->__pyx_n_s_b);
  Py_VISIT(traverse_module_state->__pyx_n_s_bind);
  Py_VISIT(traverse_module_state->__pyx_n_s_bool);
  Py_VISIT(traverse_module_state->__pyx_n_s_bucket);
  Py_VISIT(traverse_module_state->__pyx_n_s_bucket_client);
  Py_VISIT(traverse_module_state->__pyx_n_s_buelon);
  Py_VISIT(traverse_module_state->__pyx_n_s_buelon_bucket);
  Py_VISIT(traverse_module_state->__pyx_n_s_buelon_core_pipe_debug);
  Py_VISIT(traverse_module_state->__pyx_n_s_buelon_core_pipe_interpreter);
  Py_VISIT(traverse_module_state->__pyx_n_s_buelon_core_step);
  Py_VISIT(traverse_module_state->__pyx_kp_s_buelon_core_step_Step);
  Py_VISIT(traverse_module_state->__pyx_kp_s_buelon_core_step_StepStatus);
  Py_VISIT(traverse_module_state->__pyx_kp_s_buelon_core_step_Step_None);
  Py_VISIT(traverse_module_state->__pyx_n_s_buelon_cython_c_hub);
  Py_VISIT(traverse_module_state->__pyx_kp_s_buelon_cython_c_hub_pyx);
  Py_VISIT(traverse_module_state->__pyx_n_s_buelon_helpers_json_parser);
  Py_VISIT(traverse_module_state->__pyx_n_s_buelon_helpers_lazy_load_class);
  Py_VISIT(traverse_module_state->__pyx_n_s_buelon_status_map);
  Py_VISIT(traverse_module_state->__pyx_kp_u_buj_left_join_buelon_status_map);
  Py_VISIT(traverse_module_state->__pyx_n_s_bulk);
  Py_VISIT(traverse_module_state->__pyx_n_s_bulk_get);
  Py_VISIT(traverse_module_state->__pyx_n_s_bulk_get_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_bulk_get_step);
  Py_VISIT(traverse_module_state->__pyx_n_s_bulk_set);
  Py_VISIT(traverse_module_state->__pyx_n_s_bulk_set_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_bytes);
  Py_VISIT(traverse_module_state->__pyx_n_s_c);
  Py_VISIT(traverse_module_state->__pyx_kp_s_callable_None);
  Py_VISIT(traverse_module_state->__pyx_n_s_cancel);
  Py_VISIT(traverse_module_state->__pyx_n_s_cancel_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_cancels);
  Py_VISIT(traverse_module_state->__pyx_n_s_case_statement);
  Py_VISIT(traverse_module_state->__pyx_n_s_check_active_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_check_to_delete_bucket_files);
  Py_VISIT(traverse_module_state->__pyx_n_s_check_to_delete_bucket_files_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_child);
  Py_VISIT(traverse_module_state->__pyx_n_s_children);
  Py_VISIT(traverse_module_state->__pyx_n_s_children_params);
  Py_VISIT(traverse_module_state->__pyx_n_s_chunk);
  Py_VISIT(traverse_module_state->__pyx_n_s_chunk_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_clean_query_string);
  Py_VISIT(traverse_module_state->__pyx_n_s_clear);
  Py_VISIT(traverse_module_state->__pyx_n_s_client);
  Py_VISIT(traverse_module_state->__pyx_n_s_client_socket);
  Py_VISIT(traverse_module_state->__pyx_n_s_client_thread);
  Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
  Py_VISIT(traverse_module_state->__pyx_n_s_close);
  Py_VISIT(traverse_module_state->__pyx_n_s_code);
  Py_VISIT(traverse_module_state->__pyx_n_s_collections);
  Py_VISIT(traverse_module_state->__pyx_n_s_commit);
  Py_VISIT(traverse_module_state->__pyx_n_s_concurrent_futures);
  Py_VISIT(traverse_module_state->__pyx_n_s_config);
  Py_VISIT(traverse_module_state->__pyx_n_s_conn);
  Py_VISIT(traverse_module_state->__pyx_n_s_connect);
  Py_VISIT(traverse_module_state->__pyx_n_s_connection_queue);
  Py_VISIT(traverse_module_state->__pyx_n_s_core);
  Py_VISIT(traverse_module_state->__pyx_n_s_count);
  Py_VISIT(traverse_module_state->__pyx_kp_s_count_must_be_an_integer);
  Py_VISIT(traverse_module_state->__pyx_n_s_create_db_pool);
  Py_VISIT(traverse_module_state->__pyx_kp_s_create_index_if_not_exists_idx_b);
  Py_VISIT(traverse_module_state->__pyx_kp_s_create_index_if_not_exists_idx_b_2);
  Py_VISIT(traverse_module_state->__pyx_kp_s_create_index_if_not_exists_idx_b_3);
  Py_VISIT(traverse_module_state->__pyx_kp_s_create_index_if_not_exists_idx_b_4);
  Py_VISIT(traverse_module_state->__pyx_kp_s_create_table_bue_session_ids_id);
  Py_VISIT(traverse_module_state->__pyx_kp_s_create_table_if_not_exists_buelo);
  Py_VISIT(traverse_module_state->__pyx_n_s_cur);
  Py_VISIT(traverse_module_state->__pyx_n_s_cursor);
  Py_VISIT(traverse_module_state->__pyx_n_s_d);
  Py_VISIT(traverse_module_state->__pyx_n_s_daemon);
  Py_VISIT(traverse_module_state->__pyx_n_s_data);
  Py_VISIT(traverse_module_state->__pyx_kp_s_database_db);
  Py_VISIT(traverse_module_state->__pyx_n_s_db);
  Py_VISIT(traverse_module_state->__pyx_n_s_db_operation);
  Py_VISIT(traverse_module_state->__pyx_n_s_db_path);
  Py_VISIT(traverse_module_state->__pyx_n_s_db_pool);
  Py_VISIT(traverse_module_state->__pyx_n_s_decode);
  Py_VISIT(traverse_module_state->__pyx_n_s_decrement_tag_usage);
  Py_VISIT(traverse_module_state->__pyx_n_s_default);
  Py_VISIT(traverse_module_state->__pyx_n_s_defaultdict);
  Py_VISIT(traverse_module_state->__pyx_n_s_delete);
  Py_VISIT(traverse_module_state->__pyx_kp_u_delete_from_bue_session_ids_wher);
  Py_VISIT(traverse_module_state->__pyx_kp_s_delete_from_buelon_jobs);
  Py_VISIT(traverse_module_state->__pyx_kp_s_delete_from_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_delete_last_line);
  Py_VISIT(traverse_module_state->__pyx_kp_b_delete_steps);
  Py_VISIT(traverse_module_state->__pyx_kp_s_delete_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_delete_steps_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_delete_steps_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_desc);
  Py_VISIT(traverse_module_state->__pyx_n_s_description);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict_2);
  Py_VISIT(traverse_module_state->__pyx_kp_s_dict_str_Any);
  Py_VISIT(traverse_module_state->__pyx_kp_s_dict_str_buelon_core_step_Step_N);
  Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
  Py_VISIT(traverse_module_state->__pyx_n_s_doc);
  Py_VISIT(traverse_module_state->__pyx_n_s_done);
  Py_VISIT(traverse_module_state->__pyx_n_s_done_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_dones);
  Py_VISIT(traverse_module_state->__pyx_n_s_dotenv);
  Py_VISIT(traverse_module_state->__pyx_n_s_download_table);
  Py_VISIT(traverse_module_state->__pyx_kp_s_drop_table_bue_session_ids);
  Py_VISIT(traverse_module_state->__pyx_kp_s_drop_table_if_exists_bue_session);
  Py_VISIT(traverse_module_state->__pyx_n_s_dumps);
  Py_VISIT(traverse_module_state->__pyx_n_s_e);
  Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
  Py_VISIT(traverse_module_state->__pyx_n_s_encode);
  Py_VISIT(traverse_module_state->__pyx_n_s_end);
  Py_VISIT(traverse_module_state->__pyx_n_s_endswith);
  Py_VISIT(traverse_module_state->__pyx_n_s_enter);
  Py_VISIT(traverse_module_state->__pyx_n_s_enum);
  Py_VISIT(traverse_module_state->__pyx_kp_s_env);
  Py_VISIT(traverse_module_state->__pyx_n_s_environ);
  Py_VISIT(traverse_module_state->__pyx_kp_u_epoch);
  Py_VISIT(traverse_module_state->__pyx_kp_u_epoch_WHERE_id);
  Py_VISIT(traverse_module_state->__pyx_kp_u_epoch_WHERE_id_IN);
  Py_VISIT(traverse_module_state->__pyx_kp_u_epoch_msg_trace_WHERE_id);
  Py_VISIT(traverse_module_state->__pyx_n_s_error);
  Py_VISIT(traverse_module_state->__pyx_n_s_error_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_error_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_error_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_error_size_query);
  Py_VISIT(traverse_module_state->__pyx_n_s_errors);
  Py_VISIT(traverse_module_state->__pyx_n_s_exc);
  Py_VISIT(traverse_module_state->__pyx_n_s_exc_tb);
  Py_VISIT(traverse_module_state->__pyx_n_s_exc_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_exc_val);
  Py_VISIT(traverse_module_state->__pyx_n_s_exclude);
  Py_VISIT(traverse_module_state->__pyx_kp_s_exclude_must_be_a_list_of_string);
  Py_VISIT(traverse_module_state->__pyx_kp_s_exclude_must_be_a_string_or_a_li);
  Py_VISIT(traverse_module_state->__pyx_n_s_exclude_query);
  Py_VISIT(traverse_module_state->__pyx_n_s_execute);
  Py_VISIT(traverse_module_state->__pyx_n_s_execute_batch);
  Py_VISIT(traverse_module_state->__pyx_n_s_execute_db_query);
  Py_VISIT(traverse_module_state->__pyx_n_s_execute_request);
  Py_VISIT(traverse_module_state->__pyx_n_s_execute_transaction);
  Py_VISIT(traverse_module_state->__pyx_n_s_executing);
  Py_VISIT(traverse_module_state->__pyx_n_s_execution_queue);
  Py_VISIT(traverse_module_state->__pyx_n_s_executor_thread);
  Py_VISIT(traverse_module_state->__pyx_n_s_exit);
  Py_VISIT(traverse_module_state->__pyx_n_s_exit_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_expiration_time);
  Py_VISIT(traverse_module_state->__pyx_n_s_extras);
  Py_VISIT(traverse_module_state->__pyx_n_s_f);
  Py_VISIT(traverse_module_state->__pyx_n_s_fail);
  Py_VISIT(traverse_module_state->__pyx_n_b_false);
  Py_VISIT(traverse_module_state->__pyx_n_s_false);
  Py_VISIT(traverse_module_state->__pyx_n_s_fetch_errors);
  Py_VISIT(traverse_module_state->__pyx_kp_s_fetch_errors_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_fetch_errors_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_fetch_errors_locals_clean_query);
  Py_VISIT(traverse_module_state->__pyx_n_s_fetch_errors_locals_clean_query_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_fetch_errors_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_kp_s_fetch_rows);
  Py_VISIT(traverse_module_state->__pyx_n_s_fetchall);
  Py_VISIT(traverse_module_state->__pyx_n_s_file_path);
  Py_VISIT(traverse_module_state->__pyx_n_s_finished_statuses);
  Py_VISIT(traverse_module_state->__pyx_n_s_first_iteration);
  Py_VISIT(traverse_module_state->__pyx_n_s_format);
  Py_VISIT(traverse_module_state->__pyx_n_s_frame);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_json);
  Py_VISIT(traverse_module_state->__pyx_n_s_func);
  Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
  Py_VISIT(traverse_module_state->__pyx_n_s_generate_steps_from_code);
  Py_VISIT(traverse_module_state->__pyx_n_s_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_get);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_job_statuses);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_job_statuses_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_postgres_from_env);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_queue);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_rows);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_statuses);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_step);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_step_count);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_step_count_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_step_status);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_steps);
  Py_VISIT(traverse_module_state->__pyx_kp_s_get_steps_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_getattr);
  Py_VISIT(traverse_module_state->__pyx_kp_u_group_by_status);
  Py_VISIT(traverse_module_state->__pyx_kp_u_group_by_status_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_handle_client);
  Py_VISIT(traverse_module_state->__pyx_n_s_handler);
  Py_VISIT(traverse_module_state->__pyx_n_s_headers);
  Py_VISIT(traverse_module_state->__pyx_n_s_helpers);
  Py_VISIT(traverse_module_state->__pyx_n_s_host);
  Py_VISIT(traverse_module_state->__pyx_n_s_hub);
  Py_VISIT(traverse_module_state->__pyx_n_s_i);
  Py_VISIT(traverse_module_state->__pyx_n_s_id);
  Py_VISIT(traverse_module_state->__pyx_kp_u_id_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_id_IN);
  Py_VISIT(traverse_module_state->__pyx_n_s_id_column);
  Py_VISIT(traverse_module_state->__pyx_kp_s_id_in);
  Py_VISIT(traverse_module_state->__pyx_n_s_ids);
  Py_VISIT(traverse_module_state->__pyx_n_s_import);
  Py_VISIT(traverse_module_state->__pyx_n_s_include_workers);
  Py_VISIT(traverse_module_state->__pyx_n_s_include_working);
  Py_VISIT(traverse_module_state->__pyx_n_s_increments);
  Py_VISIT(traverse_module_state->__pyx_n_s_index);
  Py_VISIT(traverse_module_state->__pyx_n_s_init);
  Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
  Py_VISIT(traverse_module_state->__pyx_kp_u_insert_into_bue_session_ids_id_a);
  Py_VISIT(traverse_module_state->__pyx_n_s_inspect);
  Py_VISIT(traverse_module_state->__pyx_n_s_int);
  Py_VISIT(traverse_module_state->__pyx_kp_s_int_float);
  Py_VISIT(traverse_module_state->__pyx_kp_s_int_float_Callable);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_already_in_use_Retrying);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
  Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
  Py_VISIT(traverse_module_state->__pyx_n_s_item);
  Py_VISIT(traverse_module_state->__pyx_n_s_items);
  Py_VISIT(traverse_module_state->__pyx_n_s_job);
  Py_VISIT(traverse_module_state->__pyx_n_s_job_handler);
  Py_VISIT(traverse_module_state->__pyx_n_s_job_ids);
  Py_VISIT(traverse_module_state->__pyx_n_s_join);
  Py_VISIT(traverse_module_state->__pyx_n_s_json_parser);
  Py_VISIT(traverse_module_state->__pyx_n_s_json_table);
  Py_VISIT(traverse_module_state->__pyx_n_s_k);
  Py_VISIT(traverse_module_state->__pyx_n_s_key);
  Py_VISIT(traverse_module_state->__pyx_n_s_key_map);
  Py_VISIT(traverse_module_state->__pyx_n_s_keys);
  Py_VISIT(traverse_module_state->__pyx_n_s_kwargs);
  Py_VISIT(traverse_module_state->__pyx_n_s_lazy_load_class);
  Py_VISIT(traverse_module_state->__pyx_n_s_lazy_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_limit);
  Py_VISIT(traverse_module_state->__pyx_n_s_list);
  Py_VISIT(traverse_module_state->__pyx_kp_s_list_None);
  Py_VISIT(traverse_module_state->__pyx_kp_s_list_buelon_core_step_Step);
  Py_VISIT(traverse_module_state->__pyx_kp_s_list_dict);
  Py_VISIT(traverse_module_state->__pyx_kp_s_list_str);
  Py_VISIT(traverse_module_state->__pyx_kp_s_list_str_str_None);
  Py_VISIT(traverse_module_state->__pyx_n_s_listen);
  Py_VISIT(traverse_module_state->__pyx_n_s_load_db);
  Py_VISIT(traverse_module_state->__pyx_n_s_load_dotenv);
  Py_VISIT(traverse_module_state->__pyx_n_s_load_pg);
  Py_VISIT(traverse_module_state->__pyx_n_s_loads);
  Py_VISIT(traverse_module_state->__pyx_n_s_local);
  Py_VISIT(traverse_module_state->__pyx_n_s_localhost);
  Py_VISIT(traverse_module_state->__pyx_kp_u_lower_msg_like);
  Py_VISIT(traverse_module_state->__pyx_n_s_main);
  Py_VISIT(traverse_module_state->__pyx_n_s_main_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_max_connections);
  Py_VISIT(traverse_module_state->__pyx_n_s_max_reconnect_attempts);
  Py_VISIT(traverse_module_state->__pyx_n_s_max_workers);
  Py_VISIT(traverse_module_state->__pyx_n_s_metaclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_method);
  Py_VISIT(traverse_module_state->__pyx_n_s_min_table_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_module);
  Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries);
  Py_VISIT(traverse_module_state->__pyx_n_s_msg);
  Py_VISIT(traverse_module_state->__pyx_kp_u_msg_msg);
  Py_VISIT(traverse_module_state->__pyx_kp_u_msg_trace_trace);
  Py_VISIT(traverse_module_state->__pyx_n_s_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_new_bulk);
  Py_VISIT(traverse_module_state->__pyx_n_s_new_key);
  Py_VISIT(traverse_module_state->__pyx_n_s_new_output);
  Py_VISIT(traverse_module_state->__pyx_n_b_nothing);
  Py_VISIT(traverse_module_state->__pyx_n_s_offset);
  Py_VISIT(traverse_module_state->__pyx_n_b_ok);
  Py_VISIT(traverse_module_state->__pyx_n_s_open);
  Py_VISIT(traverse_module_state->__pyx_kp_u_or_epoch);
  Py_VISIT(traverse_module_state->__pyx_kp_u_or_status);
  Py_VISIT(traverse_module_state->__pyx_n_s_order_by);
  Py_VISIT(traverse_module_state->__pyx_n_s_os);
  Py_VISIT(traverse_module_state->__pyx_n_s_output);
  Py_VISIT(traverse_module_state->__pyx_n_s_p);
  Py_VISIT(traverse_module_state->__pyx_n_s_params);
  Py_VISIT(traverse_module_state->__pyx_n_s_parent);
  Py_VISIT(traverse_module_state->__pyx_n_s_parent_statuses);
  Py_VISIT(traverse_module_state->__pyx_n_s_parents);
  Py_VISIT(traverse_module_state->__pyx_n_s_path);
  Py_VISIT(traverse_module_state->__pyx_n_s_payload);
  Py_VISIT(traverse_module_state->__pyx_n_s_pending);
  Py_VISIT(traverse_module_state->__pyx_n_s_pending_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_pendings);
  Py_VISIT(traverse_module_state->__pyx_n_s_persistqueue);
  Py_VISIT(traverse_module_state->__pyx_n_s_pipe_debug);
  Py_VISIT(traverse_module_state->__pyx_n_s_pipe_interpreter);
  Py_VISIT(traverse_module_state->__pyx_n_s_platform);
  Py_VISIT(traverse_module_state->__pyx_n_s_port);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_cancel);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_cancels);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_delete_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_done);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_dones);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_error);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_fetch_errors);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_get_rows);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_get_step_count);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_get_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_pending);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_pendings);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_repair);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_reset);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_reset_errors);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_resets);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_upload_step);
  Py_VISIT(traverse_module_state->__pyx_n_s_postgres_upload_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_prepare);
  Py_VISIT(traverse_module_state->__pyx_n_s_print);
  Py_VISIT(traverse_module_state->__pyx_n_s_print_exc);
  Py_VISIT(traverse_module_state->__pyx_n_s_priority);
  Py_VISIT(traverse_module_state->__pyx_kp_s_priority_ASC_epoch);
  Py_VISIT(traverse_module_state->__pyx_kp_s_priority_DESC_epoch);
  Py_VISIT(traverse_module_state->__pyx_kp_s_priority_asc_epoch);
  Py_VISIT(traverse_module_state->__pyx_kp_s_priority_desc_epoch);
  Py_VISIT(traverse_module_state->__pyx_n_s_process_request);
  Py_VISIT(traverse_module_state->__pyx_n_s_process_transactions);
  Py_VISIT(traverse_module_state->__pyx_n_s_processing);
  Py_VISIT(traverse_module_state->__pyx_n_s_psycopg2);
  Py_VISIT(traverse_module_state->__pyx_n_s_put);
  Py_VISIT(traverse_module_state->__pyx_n_s_q);
  Py_VISIT(traverse_module_state->__pyx_n_s_qs);
  Py_VISIT(traverse_module_state->__pyx_n_s_qsize);
  Py_VISIT(traverse_module_state->__pyx_n_s_qualname);
  Py_VISIT(traverse_module_state->__pyx_n_s_query);
  Py_VISIT(traverse_module_state->__pyx_n_s_query_string);
  Py_VISIT(traverse_module_state->__pyx_n_s_queue);
  Py_VISIT(traverse_module_state->__pyx_n_s_queued);
  Py_VISIT(traverse_module_state->__pyx_n_s_r);
  Py_VISIT(traverse_module_state->__pyx_n_s_range);
  Py_VISIT(traverse_module_state->__pyx_n_s_read);
  Py_VISIT(traverse_module_state->__pyx_n_s_receive);
  Py_VISIT(traverse_module_state->__pyx_n_s_received);
  Py_VISIT(traverse_module_state->__pyx_n_s_recv);
  Py_VISIT(traverse_module_state->__pyx_n_s_remove_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_remove_step);
  Py_VISIT(traverse_module_state->__pyx_n_s_repair);
  Py_VISIT(traverse_module_state->__pyx_n_s_request);
  Py_VISIT(traverse_module_state->__pyx_n_s_reset);
  Py_VISIT(traverse_module_state->__pyx_n_s_reset_2);
  Py_VISIT(traverse_module_state->__pyx_kp_b_reset_errors);
  Py_VISIT(traverse_module_state->__pyx_kp_s_reset_errors);
  Py_VISIT(traverse_module_state->__pyx_n_s_reset_errors_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_reset_errors_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_reset_tag_usage);
  Py_VISIT(traverse_module_state->__pyx_n_s_resets);
  Py_VISIT(traverse_module_state->__pyx_n_s_response);
  Py_VISIT(traverse_module_state->__pyx_n_s_result);
  Py_VISIT(traverse_module_state->__pyx_n_s_retries);
  Py_VISIT(traverse_module_state->__pyx_n_s_return);
  Py_VISIT(traverse_module_state->__pyx_n_s_return_job_def_id);
  Py_VISIT(traverse_module_state->__pyx_n_s_return_job_ids);
  Py_VISIT(traverse_module_state->__pyx_n_s_reverse);
  Py_VISIT(traverse_module_state->__pyx_n_s_row);
  Py_VISIT(traverse_module_state->__pyx_n_s_rows);
  Py_VISIT(traverse_module_state->__pyx_n_s_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_s_scope);
  Py_VISIT(traverse_module_state->__pyx_kp_u_s_scope_ANY_array);
  Py_VISIT(traverse_module_state->__pyx_n_s_scope);
  Py_VISIT(traverse_module_state->__pyx_n_s_scope_section);
  Py_VISIT(traverse_module_state->__pyx_n_s_scopes);
  Py_VISIT(traverse_module_state->__pyx_kp_u_seconds);
  Py_VISIT(traverse_module_state->__pyx_kp_u_select_buj_id_bsm_name_from_sel);
  Py_VISIT(traverse_module_state->__pyx_kp_u_select_count_as_amount_min_prior);
  Py_VISIT(traverse_module_state->__pyx_kp_s_select_from_buelon_jobs_where_st);
  Py_VISIT(traverse_module_state->__pyx_kp_s_select_id_attempts_from_bue_sess);
  Py_VISIT(traverse_module_state->__pyx_kp_u_select_id_status_from_buelon_job);
  Py_VISIT(traverse_module_state->__pyx_kp_u_select_max_priority_as_priority);
  Py_VISIT(traverse_module_state->__pyx_kp_u_select_status_count_as_amount_f);
  Py_VISIT(traverse_module_state->__pyx_kp_u_select_status_count_as_amount_f_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_self);
  Py_VISIT(traverse_module_state->__pyx_n_s_send);
  Py_VISIT(traverse_module_state->__pyx_n_s_send_request);
  Py_VISIT(traverse_module_state->__pyx_n_s_sendall);
  Py_VISIT(traverse_module_state->__pyx_n_s_server);
  Py_VISIT(traverse_module_state->__pyx_n_s_set);
  Py_VISIT(traverse_module_state->__pyx_kp_s_set_None);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_step);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_setdefaulttimeout);
  Py_VISIT(traverse_module_state->__pyx_n_s_setsockopt);
  Py_VISIT(traverse_module_state->__pyx_n_s_settimeout);
  Py_VISIT(traverse_module_state->__pyx_n_s_should_finish);
  Py_VISIT(traverse_module_state->__pyx_n_s_shutdown);
  Py_VISIT(traverse_module_state->__pyx_n_s_signal);
  Py_VISIT(traverse_module_state->__pyx_kp_s_signal_only_works_in_main_thread);
  Py_VISIT(traverse_module_state->__pyx_n_s_signum);
  Py_VISIT(traverse_module_state->__pyx_n_s_sleep);
  Py_VISIT(traverse_module_state->__pyx_n_s_socket);
  Py_VISIT(traverse_module_state->__pyx_kp_s_socket_socket);
  Py_VISIT(traverse_module_state->__pyx_n_s_spec);
  Py_VISIT(traverse_module_state->__pyx_n_s_split);
  Py_VISIT(traverse_module_state->__pyx_n_s_sql);
  Py_VISIT(traverse_module_state->__pyx_n_s_sql_set_to_working);
  Py_VISIT(traverse_module_state->__pyx_n_s_sql_update_children);
  Py_VISIT(traverse_module_state->__pyx_n_s_sql_update_step);
  Py_VISIT(traverse_module_state->__pyx_n_s_sqlite3);
  Py_VISIT(traverse_module_state->__pyx_n_s_ss);
  Py_VISIT(traverse_module_state->__pyx_n_s_start);
  Py_VISIT(traverse_module_state->__pyx_n_s_state);
  Py_VISIT(traverse_module_state->__pyx_kp_u_state_archived_WHERE);
  Py_VISIT(traverse_module_state->__pyx_kp_u_state_archived_WHERE_id);
  Py_VISIT(traverse_module_state->__pyx_kp_u_state_waiting_WHERE);
  Py_VISIT(traverse_module_state->__pyx_kp_u_state_waiting_WHERE_id);
  Py_VISIT(traverse_module_state->__pyx_n_s_status);
  Py_VISIT(traverse_module_state->__pyx_n_s_status_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_status_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_statuses);
  Py_VISIT(traverse_module_state->__pyx_n_s_stdout);
  Py_VISIT(traverse_module_state->__pyx_n_s_step);
  Py_VISIT(traverse_module_state->__pyx_n_s_step_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_step_3);
  Py_VISIT(traverse_module_state->__pyx_kp_b_step_count);
  Py_VISIT(traverse_module_state->__pyx_kp_s_step_count);
  Py_VISIT(traverse_module_state->__pyx_kp_u_step_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_step_id);
  Py_VISIT(traverse_module_state->__pyx_n_s_step_ids);
  Py_VISIT(traverse_module_state->__pyx_n_s_step_json);
  Py_VISIT(traverse_module_state->__pyx_n_s_step_jsons);
  Py_VISIT(traverse_module_state->__pyx_n_s_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_str);
  Py_VISIT(traverse_module_state->__pyx_kp_s_str_None);
  Py_VISIT(traverse_module_state->__pyx_kp_s_str_list_str_None);
  Py_VISIT(traverse_module_state->__pyx_kp_s_str_list_str_tuple_str_list_str);
  Py_VISIT(traverse_module_state->__pyx_n_s_string);
  Py_VISIT(traverse_module_state->__pyx_n_s_strip);
  Py_VISIT(traverse_module_state->__pyx_n_s_submit);
  Py_VISIT(traverse_module_state->__pyx_kp_u_submit_jobs);
  Py_VISIT(traverse_module_state->__pyx_n_s_submit_pipe_code);
  Py_VISIT(traverse_module_state->__pyx_n_s_submit_pipe_code_from_file);
  Py_VISIT(traverse_module_state->__pyx_n_s_success);
  Py_VISIT(traverse_module_state->__pyx_n_s_suffix);
  Py_VISIT(traverse_module_state->__pyx_n_s_super);
  Py_VISIT(traverse_module_state->__pyx_n_s_sync);
  Py_VISIT(traverse_module_state->__pyx_n_s_sys);
  Py_VISIT(traverse_module_state->__pyx_n_s_system);
  Py_VISIT(traverse_module_state->__pyx_n_s_table);
  Py_VISIT(traverse_module_state->__pyx_n_s_tag);
  Py_VISIT(traverse_module_state->__pyx_n_s_tag_lock);
  Py_VISIT(traverse_module_state->__pyx_n_s_tag_usage);
  Py_VISIT(traverse_module_state->__pyx_n_s_tag_velocities);
  Py_VISIT(traverse_module_state->__pyx_n_s_target);
  Py_VISIT(traverse_module_state->__pyx_n_s_task_done);
  Py_VISIT(traverse_module_state->__pyx_n_s_test);
  Py_VISIT(traverse_module_state->__pyx_n_s_thread);
  Py_VISIT(traverse_module_state->__pyx_n_s_threading);
  Py_VISIT(traverse_module_state->__pyx_n_s_throw);
  Py_VISIT(traverse_module_state->__pyx_n_s_time);
  Py_VISIT(traverse_module_state->__pyx_n_s_timeout);
  Py_VISIT(traverse_module_state->__pyx_n_s_timeout_duration);
  Py_VISIT(traverse_module_state->__pyx_n_s_timeout_func);
  Py_VISIT(traverse_module_state->__pyx_n_s_timeout_func_locals_CustomTimeou);
  Py_VISIT(traverse_module_state->__pyx_n_s_timeout_func_locals_handler);
  Py_VISIT(traverse_module_state->__pyx_n_s_to_json);
  Py_VISIT(traverse_module_state->__pyx_n_s_total);
  Py_VISIT(traverse_module_state->__pyx_n_s_tqdm);
  Py_VISIT(traverse_module_state->__pyx_n_s_trace);
  Py_VISIT(traverse_module_state->__pyx_kp_u_trace_state_waiting_WHERE_id);
  Py_VISIT(traverse_module_state->__pyx_n_s_traceback);
  Py_VISIT(traverse_module_state->__pyx_n_s_transaction_queue);
  Py_VISIT(traverse_module_state->__pyx_n_b_true);
  Py_VISIT(traverse_module_state->__pyx_n_s_true);
  Py_VISIT(traverse_module_state->__pyx_n_s_types);
  Py_VISIT(traverse_module_state->__pyx_n_s_typing);
  Py_VISIT(traverse_module_state->__pyx_n_s_unsync);
  Py_VISIT(traverse_module_state->__pyx_kp_u_update_bue_session_ids_set_attem);
  Py_VISIT(traverse_module_state->__pyx_kp_u_update_buelon_jobs_set_status);
  Py_VISIT(traverse_module_state->__pyx_n_s_update_params);
  Py_VISIT(traverse_module_state->__pyx_n_s_update_query);
  Py_VISIT(traverse_module_state->__pyx_kp_u_update_steps_set_status);
  Py_VISIT(traverse_module_state->__pyx_n_s_upload_pipe_code);
  Py_VISIT(traverse_module_state->__pyx_n_s_upload_pipe_code_from_file);
  Py_VISIT(traverse_module_state->__pyx_n_s_upload_pipe_code_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_kp_b_upload_step);
  Py_VISIT(traverse_module_state->__pyx_kp_s_upload_step);
  Py_VISIT(traverse_module_state->__pyx_n_s_upload_step_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_upload_step_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_upload_steps);
  Py_VISIT(traverse_module_state->__pyx_n_s_upload_steps_2);
  Py_VISIT(traverse_module_state->__pyx_kp_s_upload_steps_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_upload_table);
  Py_VISIT(traverse_module_state->__pyx_n_s_uuid);
  Py_VISIT(traverse_module_state->__pyx_n_s_uuid1);
  Py_VISIT(traverse_module_state->__pyx_n_s_v);
  Py_VISIT(traverse_module_state->__pyx_n_s_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_velocity);
  Py_VISIT(traverse_module_state->__pyx_n_s_velocity_sql);
  Py_VISIT(traverse_module_state->__pyx_n_s_wait_until_finish);
  Py_VISIT(traverse_module_state->__pyx_n_s_waiting);
  Py_VISIT(traverse_module_state->__pyx_n_s_waiting_priority);
  Py_VISIT(traverse_module_state->__pyx_n_s_warn);
  Py_VISIT(traverse_module_state->__pyx_n_s_warnings);
  Py_VISIT(traverse_module_state->__pyx_n_s_where);
  Py_VISIT(traverse_module_state->__pyx_kp_u_where_status);
  Py_VISIT(traverse_module_state->__pyx_kp_u_where_status_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_where_status_not_in);
  Py_VISIT(traverse_module_state->__pyx_kp_u_where_status_not_in_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_worker);
  Py_VISIT(traverse_module_state->__pyx_n_s_worker_thread);
  Py_VISIT(traverse_module_state->__pyx_n_s_working);
  Py_VISIT(traverse_module_state->__pyx_n_s_working_clause);
  Py_VISIT(traverse_module_state->__pyx_n_s_write);
  Py_VISIT(traverse_module_state->__pyx_n_s_zip);
  Py_VISIT(traverse_module_state->__pyx_float_5_);
  Py_VISIT(traverse_module_state->__pyx_float_10_);
  Py_VISIT(traverse_module_state->__pyx_int_0);
  Py_VISIT(traverse_module_state->__pyx_int_1);
  Py_VISIT(traverse_module_state->__pyx_int_2);
  Py_VISIT(traverse_module_state->__pyx_int_3);
  Py_VISIT(traverse_module_state->__pyx_int_4);
  Py_VISIT(traverse_module_state->__pyx_int_5);
  Py_VISIT(traverse_module_state->__pyx_int_10);
  Py_VISIT(traverse_module_state->__pyx_int_30);
  Py_VISIT(traverse_module_state->__pyx_int_50);
  Py_VISIT(traverse_module_state->__pyx_int_60);
  Py_VISIT(traverse_module_state->__pyx_int_100);
  Py_VISIT(traverse_module_state->__pyx_int_600);
  Py_VISIT(traverse_module_state->__pyx_int_1000);
  Py_VISIT(traverse_module_state->__pyx_int_1024);
  Py_VISIT(traverse_module_state->__pyx_int_2000);
  Py_VISIT(traverse_module_state->__pyx_int_65432);
  Py_VISIT(traverse_module_state->__pyx_tuple_);
  Py_VISIT(traverse_module_state->__pyx_tuple__5);
  Py_VISIT(traverse_module_state->__pyx_tuple__6);
  Py_VISIT(traverse_module_state->__pyx_tuple__7);
  Py_VISIT(traverse_module_state->__pyx_tuple__17);
  Py_VISIT(traverse_module_state->__pyx_tuple__18);
  Py_VISIT(traverse_module_state->__pyx_tuple__19);
  Py_VISIT(traverse_module_state->__pyx_tuple__25);
  Py_VISIT(traverse_module_state->__pyx_tuple__26);
  Py_VISIT(traverse_module_state->__pyx_tuple__27);
  Py_VISIT(traverse_module_state->__pyx_tuple__28);
  Py_VISIT(traverse_module_state->__pyx_tuple__36);
  Py_VISIT(traverse_module_state->__pyx_tuple__37);
  Py_VISIT(traverse_module_state->__pyx_tuple__40);
  Py_VISIT(traverse_module_state->__pyx_tuple__41);
  Py_VISIT(traverse_module_state->__pyx_tuple__43);
  Py_VISIT(traverse_module_state->__pyx_tuple__46);
  Py_VISIT(traverse_module_state->__pyx_tuple__52);
  Py_VISIT(traverse_module_state->__pyx_tuple__53);
  Py_VISIT(traverse_module_state->__pyx_tuple__55);
  Py_VISIT(traverse_module_state->__pyx_tuple__57);
  Py_VISIT(traverse_module_state->__pyx_tuple__58);
  Py_VISIT(traverse_module_state->__pyx_tuple__59);
  Py_VISIT(traverse_module_state->__pyx_tuple__60);
  Py_VISIT(traverse_module_state->__pyx_tuple__61);
  Py_VISIT(traverse_module_state->__pyx_tuple__62);
  Py_VISIT(traverse_module_state->__pyx_tuple__63);
  Py_VISIT(traverse_module_state->__pyx_tuple__64);
  Py_VISIT(traverse_module_state->__pyx_tuple__65);
  Py_VISIT(traverse_module_state->__pyx_tuple__66);
  Py_VISIT(traverse_module_state->__pyx_tuple__67);
  Py_VISIT(traverse_module_state->__pyx_tuple__71);
  Py_VISIT(traverse_module_state->__pyx_tuple__73);
  Py_VISIT(traverse_module_state->__pyx_tuple__74);
  Py_VISIT(traverse_module_state->__pyx_tuple__76);
  Py_VISIT(traverse_module_state->__pyx_tuple__78);
  Py_VISIT(traverse_module_state->__pyx_tuple__80);
  Py_VISIT(traverse_module_state->__pyx_tuple__82);
  Py_VISIT(traverse_module_state->__pyx_tuple__84);
  Py_VISIT(traverse_module_state->__pyx_tuple__86);
  Py_VISIT(traverse_module_state->__pyx_tuple__87);
  Py_VISIT(traverse_module_state->__pyx_tuple__89);
  Py_VISIT(traverse_module_state->__pyx_tuple__90);
  Py_VISIT(traverse_module_state->__pyx_tuple__92);
  Py_VISIT(traverse_module_state->__pyx_tuple__93);
  Py_VISIT(traverse_module_state->__pyx_tuple__95);
  Py_VISIT(traverse_module_state->__pyx_tuple__97);
  Py_VISIT(traverse_module_state->__pyx_tuple__99);
  Py_VISIT(traverse_module_state->__pyx_codeobj__2);
  Py_VISIT(traverse_module_state->__pyx_tuple__101);
  Py_VISIT(traverse_module_state->__pyx_tuple__103);
  Py_VISIT(traverse_module_state->__pyx_tuple__104);
  Py_VISIT(traverse_module_state->__pyx_tuple__106);
  Py_VISIT(traverse_module_state->__pyx_tuple__107);
  Py_VISIT(traverse_module_state->__pyx_tuple__109);
  Py_VISIT(traverse_module_state->__pyx_tuple__111);
  Py_VISIT(traverse_module_state->__pyx_tuple__113);
  Py_VISIT(traverse_module_state->__pyx_tuple__115);
  Py_VISIT(traverse_module_state->__pyx_tuple__117);
  Py_VISIT(traverse_module_state->__pyx_tuple__119);
  Py_VISIT(traverse_module_state->__pyx_tuple__121);
  Py_VISIT(traverse_module_state->__pyx_tuple__123);
  Py_VISIT(traverse_module_state->__pyx_tuple__125);
  Py_VISIT(traverse_module_state->__pyx_tuple__127);
  Py_VISIT(traverse_module_state->__pyx_tuple__129);
  Py_VISIT(traverse_module_state->__pyx_tuple__131);
  Py_VISIT(traverse_module_state->__pyx_tuple__133);
  Py_VISIT(traverse_module_state->__pyx_tuple__134);
  Py_VISIT(traverse_module_state->__pyx_tuple__136);
  Py_VISIT(traverse_module_state->__pyx_tuple__138);
  Py_VISIT(traverse_module_state->__pyx_tuple__140);
  Py_VISIT(traverse_module_state->__pyx_tuple__142);
  Py_VISIT(traverse_module_state->__pyx_tuple__144);
  Py_VISIT(traverse_module_state->__pyx_tuple__146);
  Py_VISIT(traverse_module_state->__pyx_tuple__148);
  Py_VISIT(traverse_module_state->__pyx_tuple__150);
  Py_VISIT(traverse_module_state->__pyx_tuple__152);
  Py_VISIT(traverse_module_state->__pyx_tuple__155);
  Py_VISIT(traverse_module_state->__pyx_tuple__157);
  Py_VISIT(traverse_module_state->__pyx_tuple__159);
  Py_VISIT(traverse_module_state->__pyx_tuple__161);
  Py_VISIT(traverse_module_state->__pyx_tuple__166);
  Py_VISIT(traverse_module_state->__pyx_tuple__168);
  Py_VISIT(traverse_module_state->__pyx_tuple__169);
  Py_VISIT(traverse_module_state->__pyx_tuple__171);
  Py_VISIT(traverse_module_state->__pyx_tuple__172);
  Py_VISIT(traverse_module_state->__pyx_tuple__174);
  Py_VISIT(traverse_module_state->__pyx_tuple__175);
  Py_VISIT(traverse_module_state->__pyx_tuple__177);
  Py_VISIT(traverse_module_state->__pyx_tuple__179);
  Py_VISIT(traverse_module_state->__pyx_tuple__181);
  Py_VISIT(traverse_module_state->__pyx_tuple__183);
  Py_VISIT(traverse_module_state->__pyx_tuple__185);
  Py_VISIT(traverse_module_state->__pyx_tuple__187);
  Py_VISIT(traverse_module_state->__pyx_tuple__189);
  Py_VISIT(traverse_module_state->__pyx_tuple__191);
  Py_VISIT(traverse_module_state->__pyx_tuple__193);
  Py_VISIT(traverse_module_state->__pyx_tuple__197);
  Py_VISIT(traverse_module_state->__pyx_tuple__199);
  Py_VISIT(traverse_module_state->__pyx_tuple__201);
  Py_VISIT(traverse_module_state->__pyx_tuple__204);
  Py_VISIT(traverse_module_state->__pyx_tuple__212);
  Py_VISIT(traverse_module_state->__pyx_tuple__214);
  Py_VISIT(traverse_module_state->__pyx_tuple__216);
  Py_VISIT(traverse_module_state->__pyx_tuple__218);
  Py_VISIT(traverse_module_state->__pyx_tuple__220);
  Py_VISIT(traverse_module_state->__pyx_tuple__223);
  Py_VISIT(traverse_module_state->__pyx_tuple__225);
  Py_VISIT(traverse_module_state->__pyx_tuple__227);
  Py_VISIT(traverse_module_state->__pyx_tuple__229);
  Py_VISIT(traverse_module_state->__pyx_tuple__231);
  Py_VISIT(traverse_module_state->__pyx_tuple__233);
  Py_VISIT(traverse_module_state->__pyx_tuple__235);
  Py_VISIT(traverse_module_state->__pyx_tuple__237);
  Py_VISIT(traverse_module_state->__pyx_tuple__239);
  Py_VISIT(traverse_module_state->__pyx_tuple__241);
  Py_VISIT(traverse_module_state->__pyx_tuple__243);
  Py_VISIT(traverse_module_state->__pyx_tuple__245);
  Py_VISIT(traverse_module_state->__pyx_tuple__247);
  Py_VISIT(traverse_module_state->__pyx_tuple__249);
  Py_VISIT(traverse_module_state->__pyx_tuple__252);
  Py_VISIT(traverse_module_state->__pyx_tuple__254);
  Py_VISIT(traverse_module_state->__pyx_tuple__256);
  Py_VISIT(traverse_module_state->__pyx_tuple__258);
  Py_VISIT(traverse_module_state->__pyx_tuple__260);
  Py_VISIT(traverse_module_state->__pyx_tuple__262);
  Py_VISIT(traverse_module_state->__pyx_tuple__265);
  Py_VISIT(traverse_module_state->__pyx_codeobj__29);
  Py_VISIT(traverse_module_state->__pyx_codeobj__38);
  Py_VISIT(traverse_module_state->__pyx_codeobj__47);
  Py_VISIT(traverse_module_state->__pyx_codeobj__51);
  Py_VISIT(traverse_module_state->__pyx_codeobj__54);
  Py_VISIT(traverse_module_state->__pyx_codeobj__56);
  Py_VISIT(traverse_module_state->__pyx_codeobj__70);
  Py_VISIT(traverse_module_state->__pyx_codeobj__72);
  Py_VISIT(traverse_module_state->__pyx_codeobj__75);
  Py_VISIT(traverse_module_state->__pyx_codeobj__77);
  Py_VISIT(traverse_module_state->__pyx_codeobj__79);
  Py_VISIT(traverse_module_state->__pyx_codeobj__81);
  Py_VISIT(traverse_module_state->__pyx_codeobj__83);
  Py_VISIT(traverse_module_state->__pyx_codeobj__85);
  Py_VISIT(traverse_module_state->__pyx_codeobj__88);
  Py_VISIT(traverse_module_state->__pyx_codeobj__91);
  Py_VISIT(traverse_module_state->__pyx_codeobj__94);
  Py_VISIT(traverse_module_state->__pyx_codeobj__96);
  Py_VISIT(traverse_module_state->__pyx_codeobj__98);
  Py_VISIT(traverse_module_state->__pyx_codeobj__100);
  Py_VISIT(traverse_module_state->__pyx_codeobj__102);
  Py_VISIT(traverse_module_state->__pyx_codeobj__105);
  Py_VISIT(traverse_module_state->__pyx_codeobj__108);
  Py_VISIT(traverse_module_state->__pyx_codeobj__110);
  Py_VISIT(traverse_module_state->__pyx_codeobj__112);
  Py_VISIT(traverse_module_state->__pyx_codeobj__114);
  Py_VISIT(traverse_module_state->__pyx_codeobj__116);
  Py_VISIT(traverse_module_state->__pyx_codeobj__118);
  Py_VISIT(traverse_module_state->__pyx_codeobj__120);
  Py_VISIT(traverse_module_state->__pyx_codeobj__122);
  Py_VISIT(traverse_module_state->__pyx_codeobj__124);
  Py_VISIT(traverse_module_state->__pyx_codeobj__126);
  Py_VISIT(traverse_module_state->__pyx_codeobj__128);
  Py_VISIT(traverse_module_state->__pyx_codeobj__130);
  Py_VISIT(traverse_module_state->__pyx_codeobj__132);
  Py_VISIT(traverse_module_state->__pyx_codeobj__135);
  Py_VISIT(traverse_module_state->__pyx_codeobj__137);
  Py_VISIT(traverse_module_state->__pyx_codeobj__139);
  Py_VISIT(traverse_module_state->__pyx_codeobj__141);
  Py_VISIT(traverse_module_state->__pyx_codeobj__143);
  Py_VISIT(traverse_module_state->__pyx_codeobj__145);
  Py_VISIT(traverse_module_state->__pyx_codeobj__147);
  Py_VISIT(traverse_module_state->__pyx_codeobj__149);
  Py_VISIT(traverse_module_state->__pyx_codeobj__151);
  Py_VISIT(traverse_module_state->__pyx_codeobj__153);
  Py_VISIT(traverse_module_state->__pyx_codeobj__154);
  Py_VISIT(traverse_module_state->__pyx_codeobj__156);
  Py_VISIT(traverse_module_state->__pyx_codeobj__158);
  Py_VISIT(traverse_module_state->__pyx_codeobj__160);
  Py_VISIT(traverse_module_state->__pyx_codeobj__162);
  Py_VISIT(traverse_module_state->__pyx_codeobj__163);
  Py_VISIT(traverse_module_state->__pyx_codeobj__164);
  Py_VISIT(traverse_module_state->__pyx_codeobj__165);
  Py_VISIT(traverse_module_state->__pyx_codeobj__167);
  Py_VISIT(traverse_module_state->__pyx_codeobj__170);
  Py_VISIT(traverse_module_state->__pyx_codeobj__173);
  Py_VISIT(traverse_module_state->__pyx_codeobj__176);
  Py_VISIT(traverse_module_state->__pyx_codeobj__178);
  Py_VISIT(traverse_module_state->__pyx_codeobj__180);
  Py_VISIT(traverse_module_state->__pyx_codeobj__182);
  Py_VISIT(traverse_module_state->__pyx_codeobj__184);
  Py_VISIT(traverse_module_state->__pyx_codeobj__186);
  Py_VISIT(traverse_module_state->__pyx_codeobj__188);
  Py_VISIT(traverse_module_state->__pyx_codeobj__190);
  Py_VISIT(traverse_module_state->__pyx_codeobj__192);
  Py_VISIT(traverse_module_state->__pyx_codeobj__194);
  Py_VISIT(traverse_module_state->__pyx_codeobj__195);
  Py_VISIT(traverse_module_state->__pyx_codeobj__196);
  Py_VISIT(traverse_module_state->__pyx_codeobj__198);
  Py_VISIT(traverse_module_state->__pyx_codeobj__200);
  Py_VISIT(traverse_module_state->__pyx_codeobj__202);
  Py_VISIT(traverse_module_state->__pyx_codeobj__203);
  Py_VISIT(traverse_module_state->__pyx_codeobj__205);
  Py_VISIT(traverse_module_state->__pyx_codeobj__206);
  Py_VISIT(traverse_module_state->__pyx_codeobj__207);
  Py_VISIT(traverse_module_state->__pyx_codeobj__208);
  Py_VISIT(traverse_module_state->__pyx_codeobj__209);
  Py_VISIT(traverse_module_state->__pyx_codeobj__210);
  Py_VISIT(traverse_module_state->__pyx_codeobj__211);
  Py_VISIT(traverse_module_state->__pyx_codeobj__213);
  Py_VISIT(traverse_module_state->__pyx_codeobj__215);
  Py_VISIT(traverse_module_state->__pyx_codeobj__217);
  Py_VISIT(traverse_module_state->__pyx_codeobj__219);
  Py_VISIT(traverse_module_state->__pyx_codeobj__221);
  Py_VISIT(traverse_module_state->__pyx_codeobj__222);
  Py_VISIT(traverse_module_state->__pyx_codeobj__224);
  Py_VISIT(traverse_module_state->__pyx_codeobj__226);
  Py_VISIT(traverse_module_state->__pyx_codeobj__228);
  Py_VISIT(traverse_module_state->__pyx_codeobj__230);
  Py_VISIT(traverse_module_state->__pyx_codeobj__232);
  Py_VISIT(traverse_module_state->__pyx_codeobj__234);
  Py_VISIT(traverse_module_state->__pyx_codeobj__236);
  Py_VISIT(traverse_module_state->__pyx_codeobj__238);
  Py_VISIT(traverse_module_state->__pyx_codeobj__240);
  Py_VISIT(traverse_module_state->__pyx_codeobj__242);
  Py_VISIT(traverse_module_state->__pyx_codeobj__244);
  Py_VISIT(traverse_module_state->__pyx_codeobj__246);
  Py_VISIT(traverse_module_state->__pyx_codeobj__248);
  Py_VISIT(traverse_module_state->__pyx_codeobj__250);
  Py_VISIT(traverse_module_state->__pyx_codeobj__251);
  Py_VISIT(traverse_module_state->__pyx_codeobj__253);
  Py_VISIT(traverse_module_state->__pyx_codeobj__255);
  Py_VISIT(traverse_module_state->__pyx_codeobj__257);
  Py_VISIT(traverse_module_state->__pyx_codeobj__259);
  Py_VISIT(traverse_module_state->__pyx_codeobj__261);
  Py_VISIT(traverse_module_state->__pyx_codeobj__263);
  Py_VISIT(traverse_module_state->__pyx_codeobj__264);
  Py_VISIT(traverse_module_state->__pyx_codeobj__266);
  return 0;
}
#endif
/* #### Code section: module_state_defines ### */
#define __pyx_d __pyx_mstate_global->__pyx_d
#define __pyx_b __pyx_mstate_global->__pyx_b
#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
#ifdef __Pyx_CyFunction_USED
#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
#endif
#ifdef __Pyx_FusedFunction_USED
#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
#endif
#ifdef __Pyx_Generator_USED
#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
#endif
#ifdef __Pyx_IterableCoroutine_USED
#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
#endif
#if CYTHON_USE_MODULE_STATE
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair
#define __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr __pyx_mstate_global->__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr
#endif
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair
#define __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr __pyx_mstate_global->__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr
#define __pyx_kp_u_0 __pyx_mstate_global->__pyx_kp_u_0
#define __pyx_kp_s_0_0_0_0 __pyx_mstate_global->__pyx_kp_s_0_0_0_0
#define __pyx_n_s_AF_INET __pyx_mstate_global->__pyx_n_s_AF_INET
#define __pyx_kp_s_AND_not __pyx_mstate_global->__pyx_kp_s_AND_not
#define __pyx_kp_u_AND_not_lower_msg_like __pyx_mstate_global->__pyx_kp_u_AND_not_lower_msg_like
#define __pyx_kp_u_AND_s_status __pyx_mstate_global->__pyx_kp_u_AND_s_status
#define __pyx_kp_u_AND_s_status_2 __pyx_mstate_global->__pyx_kp_u_AND_s_status_2
#define __pyx_kp_u_AND_s_status_3 __pyx_mstate_global->__pyx_kp_u_AND_s_status_3
#define __pyx_kp_u_AND_status __pyx_mstate_global->__pyx_kp_u_AND_status
#define __pyx_kp_u_AND_status_2 __pyx_mstate_global->__pyx_kp_u_AND_status_2
#define __pyx_n_s_Any __pyx_mstate_global->__pyx_n_s_Any
#define __pyx_n_s_AttributeError __pyx_mstate_global->__pyx_n_s_AttributeError
#define __pyx_n_s_CANCEL __pyx_mstate_global->__pyx_n_s_CANCEL
#define __pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s __pyx_mstate_global->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s
#define __pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_2 __pyx_mstate_global->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_2
#define __pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_3 __pyx_mstate_global->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_3
#define __pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_4 __pyx_mstate_global->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_4
#define __pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_5 __pyx_mstate_global->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_5
#define __pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_6 __pyx_mstate_global->__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_6
#define __pyx_kp_s_CREATE_INDEX_if_not_exists_idx_b __pyx_mstate_global->__pyx_kp_s_CREATE_INDEX_if_not_exists_idx_b
#define __pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo __pyx_mstate_global->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo
#define __pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_2 __pyx_mstate_global->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_2
#define __pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_3 __pyx_mstate_global->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_3
#define __pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_steps __pyx_mstate_global->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_steps
#define __pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags __pyx_mstate_global->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags
#define __pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags_2 __pyx_mstate_global->__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags_2
#define __pyx_kp_s_CREATE_UNIQUE_INDEX_IF_NOT_EXIST __pyx_mstate_global->__pyx_kp_s_CREATE_UNIQUE_INDEX_IF_NOT_EXIST
#define __pyx_n_s_Callable __pyx_mstate_global->__pyx_n_s_Callable
#define __pyx_n_s_Client __pyx_mstate_global->__pyx_n_s_Client
#define __pyx_n_s_ConnectionRefusedError __pyx_mstate_global->__pyx_n_s_ConnectionRefusedError
#define __pyx_n_s_CustomTimeoutError __pyx_mstate_global->__pyx_n_s_CustomTimeoutError
#define __pyx_n_s_DEFAULT_SCOPES __pyx_mstate_global->__pyx_n_s_DEFAULT_SCOPES
#define __pyx_n_s_DELETE_STEPS __pyx_mstate_global->__pyx_n_s_DELETE_STEPS
#define __pyx_n_s_DONE __pyx_mstate_global->__pyx_n_s_DONE
#define __pyx_n_s_Done __pyx_mstate_global->__pyx_n_s_Done
#define __pyx_n_s_ERROR __pyx_mstate_global->__pyx_n_s_ERROR
#define __pyx_n_s_Enum __pyx_mstate_global->__pyx_n_s_Enum
#define __pyx_kp_s_Error __pyx_mstate_global->__pyx_kp_s_Error
#define __pyx_kp_u_Error_processing_transaction __pyx_mstate_global->__pyx_kp_u_Error_processing_transaction
#define __pyx_kp_s_F __pyx_mstate_global->__pyx_kp_s_F
#define __pyx_n_s_FETCH_ERRORS __pyx_mstate_global->__pyx_n_s_FETCH_ERRORS
#define __pyx_n_s_FETCH_ROWS __pyx_mstate_global->__pyx_n_s_FETCH_ROWS
#define __pyx_kp_u_FOR_UPDATE_SKIP_LOCKED __pyx_mstate_global->__pyx_kp_u_FOR_UPDATE_SKIP_LOCKED
#define __pyx_kp_u_FOR_UPDATE_SKIP_LOCKED_RETURNIN __pyx_mstate_global->__pyx_kp_u_FOR_UPDATE_SKIP_LOCKED_RETURNIN
#define __pyx_kp_s_Fetching_data_for_jobs_by_1_000 __pyx_mstate_global->__pyx_kp_s_Fetching_data_for_jobs_by_1_000
#define __pyx_kp_s_Fetching_parents_of_jobs_by_1_00 __pyx_mstate_global->__pyx_kp_s_Fetching_parents_of_jobs_by_1_00
#define __pyx_kp_s_Fetching_queued_not_finished_job __pyx_mstate_global->__pyx_kp_s_Fetching_queued_not_finished_job
#define __pyx_n_s_GET_STEPS __pyx_mstate_global->__pyx_n_s_GET_STEPS
#define __pyx_n_s_HubClient __pyx_mstate_global->__pyx_n_s_HubClient
#define __pyx_n_s_HubClient___enter __pyx_mstate_global->__pyx_n_s_HubClient___enter
#define __pyx_n_s_HubClient___exit __pyx_mstate_global->__pyx_n_s_HubClient___exit
#define __pyx_n_s_HubClient___getattr __pyx_mstate_global->__pyx_n_s_HubClient___getattr
#define __pyx_n_s_HubClient___init __pyx_mstate_global->__pyx_n_s_HubClient___init
#define __pyx_n_s_HubClient__already __pyx_mstate_global->__pyx_n_s_HubClient__already
#define __pyx_n_s_HubClient_cancel __pyx_mstate_global->__pyx_n_s_HubClient_cancel
#define __pyx_n_s_HubClient_cancels __pyx_mstate_global->__pyx_n_s_HubClient_cancels
#define __pyx_n_s_HubClient_close __pyx_mstate_global->__pyx_n_s_HubClient_close
#define __pyx_n_s_HubClient_connect __pyx_mstate_global->__pyx_n_s_HubClient_connect
#define __pyx_n_s_HubClient_delete_steps __pyx_mstate_global->__pyx_n_s_HubClient_delete_steps
#define __pyx_n_s_HubClient_done __pyx_mstate_global->__pyx_n_s_HubClient_done
#define __pyx_n_s_HubClient_dones __pyx_mstate_global->__pyx_n_s_HubClient_dones
#define __pyx_n_s_HubClient_error __pyx_mstate_global->__pyx_n_s_HubClient_error
#define __pyx_n_s_HubClient_fetch_errors __pyx_mstate_global->__pyx_n_s_HubClient_fetch_errors
#define __pyx_n_s_HubClient_get_rows __pyx_mstate_global->__pyx_n_s_HubClient_get_rows
#define __pyx_n_s_HubClient_get_step_count __pyx_mstate_global->__pyx_n_s_HubClient_get_step_count
#define __pyx_n_s_HubClient_get_steps __pyx_mstate_global->__pyx_n_s_HubClient_get_steps
#define __pyx_n_s_HubClient_load_pg __pyx_mstate_global->__pyx_n_s_HubClient_load_pg
#define __pyx_n_s_HubClient_pending __pyx_mstate_global->__pyx_n_s_HubClient_pending
#define __pyx_n_s_HubClient_pendings __pyx_mstate_global->__pyx_n_s_HubClient_pendings
#define __pyx_n_s_HubClient_postgres_cancel __pyx_mstate_global->__pyx_n_s_HubClient_postgres_cancel
#define __pyx_n_s_HubClient_postgres_cancels __pyx_mstate_global->__pyx_n_s_HubClient_postgres_cancels
#define __pyx_n_s_HubClient_postgres_cancels_local __pyx_mstate_global->__pyx_n_s_HubClient_postgres_cancels_local
#define __pyx_n_s_HubClient_postgres_delete_steps __pyx_mstate_global->__pyx_n_s_HubClient_postgres_delete_steps
#define __pyx_n_s_HubClient_postgres_done __pyx_mstate_global->__pyx_n_s_HubClient_postgres_done
#define __pyx_n_s_HubClient_postgres_done_locals_g __pyx_mstate_global->__pyx_n_s_HubClient_postgres_done_locals_g
#define __pyx_n_s_HubClient_postgres_dones __pyx_mstate_global->__pyx_n_s_HubClient_postgres_dones
#define __pyx_n_s_HubClient_postgres_dones_locals __pyx_mstate_global->__pyx_n_s_HubClient_postgres_dones_locals
#define __pyx_n_s_HubClient_postgres_error __pyx_mstate_global->__pyx_n_s_HubClient_postgres_error
#define __pyx_n_s_HubClient_postgres_fetch_errors __pyx_mstate_global->__pyx_n_s_HubClient_postgres_fetch_errors
#define __pyx_n_s_HubClient_postgres_fetch_errors_2 __pyx_mstate_global->__pyx_n_s_HubClient_postgres_fetch_errors_2
#define __pyx_n_s_HubClient_postgres_fetch_errors_3 __pyx_mstate_global->__pyx_n_s_HubClient_postgres_fetch_errors_3
#define __pyx_n_s_HubClient_postgres_fetch_errors_4 __pyx_mstate_global->__pyx_n_s_HubClient_postgres_fetch_errors_4
#define __pyx_n_s_HubClient_postgres_get_rows __pyx_mstate_global->__pyx_n_s_HubClient_postgres_get_rows
#define __pyx_n_s_HubClient_postgres_get_step_coun __pyx_mstate_global->__pyx_n_s_HubClient_postgres_get_step_coun
#define __pyx_n_s_HubClient_postgres_get_steps __pyx_mstate_global->__pyx_n_s_HubClient_postgres_get_steps
#define __pyx_n_s_HubClient_postgres_get_steps_loc __pyx_mstate_global->__pyx_n_s_HubClient_postgres_get_steps_loc
#define __pyx_n_s_HubClient_postgres_get_steps_loc_2 __pyx_mstate_global->__pyx_n_s_HubClient_postgres_get_steps_loc_2
#define __pyx_n_s_HubClient_postgres_pending __pyx_mstate_global->__pyx_n_s_HubClient_postgres_pending
#define __pyx_n_s_HubClient_postgres_pendings __pyx_mstate_global->__pyx_n_s_HubClient_postgres_pendings
#define __pyx_n_s_HubClient_postgres_pendings_loca __pyx_mstate_global->__pyx_n_s_HubClient_postgres_pendings_loca
#define __pyx_n_s_HubClient_postgres_repair __pyx_mstate_global->__pyx_n_s_HubClient_postgres_repair
#define __pyx_n_s_HubClient_postgres_repair_locals __pyx_mstate_global->__pyx_n_s_HubClient_postgres_repair_locals
#define __pyx_n_s_HubClient_postgres_repair_locals_2 __pyx_mstate_global->__pyx_n_s_HubClient_postgres_repair_locals_2
#define __pyx_n_s_HubClient_postgres_repair_locals_3 __pyx_mstate_global->__pyx_n_s_HubClient_postgres_repair_locals_3
#define __pyx_n_s_HubClient_postgres_reset __pyx_mstate_global->__pyx_n_s_HubClient_postgres_reset
#define __pyx_n_s_HubClient_postgres_reset_errors __pyx_mstate_global->__pyx_n_s_HubClient_postgres_reset_errors
#define __pyx_n_s_HubClient_postgres_resets __pyx_mstate_global->__pyx_n_s_HubClient_postgres_resets
#define __pyx_n_s_HubClient_postgres_resets_locals __pyx_mstate_global->__pyx_n_s_HubClient_postgres_resets_locals
#define __pyx_n_s_HubClient_postgres_upload_step __pyx_mstate_global->__pyx_n_s_HubClient_postgres_upload_step
#define __pyx_n_s_HubClient_postgres_upload_steps __pyx_mstate_global->__pyx_n_s_HubClient_postgres_upload_steps
#define __pyx_n_s_HubClient_repair __pyx_mstate_global->__pyx_n_s_HubClient_repair
#define __pyx_kp_s_HubClient_repair_is_only_impleme __pyx_mstate_global->__pyx_kp_s_HubClient_repair_is_only_impleme
#define __pyx_n_s_HubClient_reset __pyx_mstate_global->__pyx_n_s_HubClient_reset
#define __pyx_n_s_HubClient_reset_errors __pyx_mstate_global->__pyx_n_s_HubClient_reset_errors
#define __pyx_n_s_HubClient_resets __pyx_mstate_global->__pyx_n_s_HubClient_resets
#define __pyx_n_s_HubClient_send_request __pyx_mstate_global->__pyx_n_s_HubClient_send_request
#define __pyx_n_s_HubClient_upload_step __pyx_mstate_global->__pyx_n_s_HubClient_upload_step
#define __pyx_n_s_HubClient_upload_steps __pyx_mstate_global->__pyx_n_s_HubClient_upload_steps
#define __pyx_kp_s_HubClient_used_outside_the_main __pyx_mstate_global->__pyx_kp_s_HubClient_used_outside_the_main
#define __pyx_n_s_HubServer __pyx_mstate_global->__pyx_n_s_HubServer
#define __pyx_n_s_HubServer___init __pyx_mstate_global->__pyx_n_s_HubServer___init
#define __pyx_n_s_HubServer__execute_request __pyx_mstate_global->__pyx_n_s_HubServer__execute_request
#define __pyx_n_s_HubServer__execute_transaction __pyx_mstate_global->__pyx_n_s_HubServer__execute_transaction
#define __pyx_n_s_HubServer__handle_client __pyx_mstate_global->__pyx_n_s_HubServer__handle_client
#define __pyx_n_s_HubServer__process_request __pyx_mstate_global->__pyx_n_s_HubServer__process_request
#define __pyx_n_s_HubServer__process_request_local __pyx_mstate_global->__pyx_n_s_HubServer__process_request_local
#define __pyx_n_s_HubServer__process_transactions __pyx_mstate_global->__pyx_n_s_HubServer__process_transactions
#define __pyx_n_s_HubServer_create_db_pool __pyx_mstate_global->__pyx_n_s_HubServer_create_db_pool
#define __pyx_n_s_HubServer_execute_db_query __pyx_mstate_global->__pyx_n_s_HubServer_execute_db_query
#define __pyx_n_s_HubServer_execute_db_query_local __pyx_mstate_global->__pyx_n_s_HubServer_execute_db_query_local
#define __pyx_n_s_HubServer_get_steps __pyx_mstate_global->__pyx_n_s_HubServer_get_steps
#define __pyx_n_s_HubServer_get_steps_locals_genex __pyx_mstate_global->__pyx_n_s_HubServer_get_steps_locals_genex
#define __pyx_n_s_HubServer_start __pyx_mstate_global->__pyx_n_s_HubServer_start
#define __pyx_kp_s_INSERT_INTO_buelon_jobs_waiting __pyx_mstate_global->__pyx_kp_s_INSERT_INTO_buelon_jobs_waiting
#define __pyx_kp_s_INSERT_INTO_steps_id_priority_sc __pyx_mstate_global->__pyx_kp_s_INSERT_INTO_steps_id_priority_sc
#define __pyx_n_s_IPPROTO_TCP __pyx_mstate_global->__pyx_n_s_IPPROTO_TCP
#define __pyx_n_s_InsufficientPrivilege __pyx_mstate_global->__pyx_n_s_InsufficientPrivilege
#define __pyx_kp_s_Insufficient_privileges_to_creat __pyx_mstate_global->__pyx_kp_s_Insufficient_privileges_to_creat
#define __pyx_kp_u_Invalid_method __pyx_mstate_global->__pyx_kp_u_Invalid_method
#define __pyx_kp_u_Invalid_value_received __pyx_mstate_global->__pyx_kp_u_Invalid_value_received
#define __pyx_kp_s_K __pyx_mstate_global->__pyx_kp_s_K
#define __pyx_n_s_KeyboardInterrupt __pyx_mstate_global->__pyx_n_s_KeyboardInterrupt
#define __pyx_n_s_LENGTH_OF_PIPELINE_END_TOKEN __pyx_mstate_global->__pyx_n_s_LENGTH_OF_PIPELINE_END_TOKEN
#define __pyx_kp_u_LIMIT __pyx_mstate_global->__pyx_kp_u_LIMIT
#define __pyx_kp_u_LIMIT_2 __pyx_mstate_global->__pyx_kp_u_LIMIT_2
#define __pyx_kp_u_LIMIT_3 __pyx_mstate_global->__pyx_kp_u_LIMIT_3
#define __pyx_kp_u_LIMIT_4 __pyx_mstate_global->__pyx_kp_u_LIMIT_4
#define __pyx_kp_u_LIMIT_5 __pyx_mstate_global->__pyx_kp_u_LIMIT_5
#define __pyx_kp_u_LIMIT_OFFSET __pyx_mstate_global->__pyx_kp_u_LIMIT_OFFSET
#define __pyx_n_s_Lock __pyx_mstate_global->__pyx_n_s_Lock
#define __pyx_kp_s_Max_errors_met __pyx_mstate_global->__pyx_kp_s_Max_errors_met
#define __pyx_n_s_Method __pyx_mstate_global->__pyx_n_s_Method
#define __pyx_n_s_ModuleNotFoundError __pyx_mstate_global->__pyx_n_s_ModuleNotFoundError
#define __pyx_kp_u_No_data_found_for_step __pyx_mstate_global->__pyx_kp_u_No_data_found_for_step
#define __pyx_n_s_None __pyx_mstate_global->__pyx_n_s_None
#define __pyx_kp_u_None __pyx_mstate_global->__pyx_kp_u_None
#define __pyx_kp_s_OR __pyx_mstate_global->__pyx_kp_s_OR
#define __pyx_kp_u_ORDER_BY __pyx_mstate_global->__pyx_kp_u_ORDER_BY
#define __pyx_kp_u_ORDER_BY_2 __pyx_mstate_global->__pyx_kp_u_ORDER_BY_2
#define __pyx_kp_u_ORDER_BY_3 __pyx_mstate_global->__pyx_kp_u_ORDER_BY_3
#define __pyx_kp_u_ORDER_BY_4 __pyx_mstate_global->__pyx_kp_u_ORDER_BY_4
#define __pyx_kp_u_OR_epoch_coalesce_timeout __pyx_mstate_global->__pyx_kp_u_OR_epoch_coalesce_timeout
#define __pyx_kp_u_OR_lower_trace_like __pyx_mstate_global->__pyx_kp_u_OR_lower_trace_like
#define __pyx_n_s_OSError __pyx_mstate_global->__pyx_n_s_OSError
#define __pyx_n_s_PENDING __pyx_mstate_global->__pyx_n_s_PENDING
#define __pyx_n_s_PIPELINE_END_TOKEN __pyx_mstate_global->__pyx_n_s_PIPELINE_END_TOKEN
#define __pyx_n_s_PIPELINE_HOST __pyx_mstate_global->__pyx_n_s_PIPELINE_HOST
#define __pyx_n_s_PIPELINE_PORT __pyx_mstate_global->__pyx_n_s_PIPELINE_PORT
#define __pyx_n_s_PIPELINE_SPLIT_TOKEN __pyx_mstate_global->__pyx_n_s_PIPELINE_SPLIT_TOKEN
#define __pyx_n_s_PIPE_WORKER_HOST __pyx_mstate_global->__pyx_n_s_PIPE_WORKER_HOST
#define __pyx_n_s_PIPE_WORKER_PORT __pyx_mstate_global->__pyx_n_s_PIPE_WORKER_PORT
#define __pyx_kp_s_PRAGMA_journal_mode_WAL __pyx_mstate_global->__pyx_kp_s_PRAGMA_journal_mode_WAL
#define __pyx_kp_u_Port __pyx_mstate_global->__pyx_kp_u_Port
#define __pyx_n_s_Queue __pyx_mstate_global->__pyx_n_s_Queue
#define __pyx_n_s_RESET __pyx_mstate_global->__pyx_n_s_RESET
#define __pyx_n_s_RESET_ERRORS __pyx_mstate_global->__pyx_n_s_RESET_ERRORS
#define __pyx_kp_s_Repairing_Steps_Commits_every_1 __pyx_mstate_global->__pyx_kp_s_Repairing_Steps_Commits_every_1
#define __pyx_kp_u_Request_timed_out_after __pyx_mstate_global->__pyx_kp_u_Request_timed_out_after
#define __pyx_kp_u_SELECT_COUNT_FROM_buelon_jobs_WH __pyx_mstate_global->__pyx_kp_u_SELECT_COUNT_FROM_buelon_jobs_WH
#define __pyx_kp_u_SELECT_COUNT_FROM_steps_WHERE_st __pyx_mstate_global->__pyx_kp_u_SELECT_COUNT_FROM_steps_WHERE_st
#define __pyx_kp_u_SELECT_FROM_buelon_jobs_WHERE_id __pyx_mstate_global->__pyx_kp_u_SELECT_FROM_buelon_jobs_WHERE_id
#define __pyx_kp_u_SELECT_FROM_steps_WHERE_id __pyx_mstate_global->__pyx_kp_u_SELECT_FROM_steps_WHERE_id
#define __pyx_kp_u_SELECT_id_msg_trace_FROM_buelon __pyx_mstate_global->__pyx_kp_u_SELECT_id_msg_trace_FROM_buelon
#define __pyx_kp_u_SELECT_id_msg_trace_FROM_steps_W __pyx_mstate_global->__pyx_kp_u_SELECT_id_msg_trace_FROM_steps_W
#define __pyx_kp_u_SELECT_id_priority_scope_velocit __pyx_mstate_global->__pyx_kp_u_SELECT_id_priority_scope_velocit
#define __pyx_kp_u_SELECT_s_id_s_id_s_priority_s_s __pyx_mstate_global->__pyx_kp_u_SELECT_s_id_s_id_s_priority_s_s
#define __pyx_kp_u_SELECT_status_FROM_steps_WHERE_i __pyx_mstate_global->__pyx_kp_u_SELECT_status_FROM_steps_WHERE_i
#define __pyx_kp_s_SELECT_tag_velocity_FROM_tags __pyx_mstate_global->__pyx_kp_s_SELECT_tag_velocity_FROM_tags
#define __pyx_n_s_SHUT_RDWR __pyx_mstate_global->__pyx_n_s_SHUT_RDWR
#define __pyx_n_s_SIGALRM __pyx_mstate_global->__pyx_n_s_SIGALRM
#define __pyx_n_s_SOCK_STREAM __pyx_mstate_global->__pyx_n_s_SOCK_STREAM
#define __pyx_n_s_SQLiteQueue __pyx_mstate_global->__pyx_n_s_SQLiteQueue
#define __pyx_n_s_STEP_COUNT __pyx_mstate_global->__pyx_n_s_STEP_COUNT
#define __pyx_kp_u_Server_listening_on __pyx_mstate_global->__pyx_kp_u_Server_listening_on
#define __pyx_n_s_Step __pyx_mstate_global->__pyx_n_s_Step
#define __pyx_n_s_StepStatus __pyx_mstate_global->__pyx_n_s_StepStatus
#define __pyx_kp_s_TAB_scope_scope_priority_priorit __pyx_mstate_global->__pyx_kp_s_TAB_scope_scope_priority_priorit
#define __pyx_n_s_TCP_NODELAY __pyx_mstate_global->__pyx_n_s_TCP_NODELAY
#define __pyx_n_s_Thread __pyx_mstate_global->__pyx_n_s_Thread
#define __pyx_n_s_ThreadPoolExecutor __pyx_mstate_global->__pyx_n_s_ThreadPoolExecutor
#define __pyx_n_s_ThreadSafeSQLiteQueue __pyx_mstate_global->__pyx_n_s_ThreadSafeSQLiteQueue
#define __pyx_n_s_ThreadSafeSQLiteQueue___init __pyx_mstate_global->__pyx_n_s_ThreadSafeSQLiteQueue___init
#define __pyx_n_s_ThreadSafeSQLiteQueue__get_queue __pyx_mstate_global->__pyx_n_s_ThreadSafeSQLiteQueue__get_queue
#define __pyx_n_s_ThreadSafeSQLiteQueue_get __pyx_mstate_global->__pyx_n_s_ThreadSafeSQLiteQueue_get
#define __pyx_n_s_ThreadSafeSQLiteQueue_put __pyx_mstate_global->__pyx_n_s_ThreadSafeSQLiteQueue_put
#define __pyx_n_s_ThreadSafeSQLiteQueue_qsize __pyx_mstate_global->__pyx_n_s_ThreadSafeSQLiteQueue_qsize
#define __pyx_n_s_ThreadSafeSQLiteQueue_task_done __pyx_mstate_global->__pyx_n_s_ThreadSafeSQLiteQueue_task_done
#define __pyx_n_s_TimeoutError __pyx_mstate_global->__pyx_n_s_TimeoutError
#define __pyx_kp_u_UPDATE_buelon_jobs_SET_status __pyx_mstate_global->__pyx_kp_u_UPDATE_buelon_jobs_SET_status
#define __pyx_kp_u_UPDATE_buelon_jobs_s_SET_state __pyx_mstate_global->__pyx_kp_u_UPDATE_buelon_jobs_s_SET_state
#define __pyx_kp_u_UPDATE_steps_SET_status __pyx_mstate_global->__pyx_kp_u_UPDATE_steps_SET_status
#define __pyx_kp_u_UPDATE_steps_SET_status_epoch_W __pyx_mstate_global->__pyx_kp_u_UPDATE_steps_SET_status_epoch_W
#define __pyx_n_s_UPLOAD_STEP __pyx_mstate_global->__pyx_n_s_UPLOAD_STEP
#define __pyx_n_s_UPLOAD_STEPS __pyx_mstate_global->__pyx_n_s_UPLOAD_STEPS
#define __pyx_n_s_USING_POSTGRES __pyx_mstate_global->__pyx_n_s_USING_POSTGRES
#define __pyx_n_s_USING_POSTGRES_HUB __pyx_mstate_global->__pyx_n_s_USING_POSTGRES_HUB
#define __pyx_kp_s_Uploading_Jobs __pyx_mstate_global->__pyx_kp_s_Uploading_Jobs
#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
#define __pyx_kp_u_WHEN_THEN __pyx_mstate_global->__pyx_kp_u_WHEN_THEN
#define __pyx_kp_u_WHERE_id_IN __pyx_mstate_global->__pyx_kp_u_WHERE_id_IN
#define __pyx_kp_u_WHERE_s_id_IN_SELECT_s_id_FROM __pyx_mstate_global->__pyx_kp_u_WHERE_s_id_IN_SELECT_s_id_FROM
#define __pyx_kp_u_WITH_updated_jobs_AS_UPDATE_bue __pyx_mstate_global->__pyx_kp_u_WITH_updated_jobs_AS_UPDATE_bue
#define __pyx_n_s_WORKER_HOST __pyx_mstate_global->__pyx_n_s_WORKER_HOST
#define __pyx_n_s_WORKER_PORT __pyx_mstate_global->__pyx_n_s_WORKER_PORT
#define __pyx_n_s_Windows __pyx_mstate_global->__pyx_n_s_Windows
#define __pyx_kp_s__10 __pyx_mstate_global->__pyx_kp_s__10
#define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10
#define __pyx_kp_s__11 __pyx_mstate_global->__pyx_kp_s__11
#define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12
#define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13
#define __pyx_kp_s__14 __pyx_mstate_global->__pyx_kp_s__14
#define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14
#define __pyx_kp_s__15 __pyx_mstate_global->__pyx_kp_s__15
#define __pyx_kp_u__16 __pyx_mstate_global->__pyx_kp_u__16
#define __pyx_kp_s__20 __pyx_mstate_global->__pyx_kp_s__20
#define __pyx_kp_s__21 __pyx_mstate_global->__pyx_kp_s__21
#define __pyx_kp_s__22 __pyx_mstate_global->__pyx_kp_s__22
#define __pyx_kp_s__23 __pyx_mstate_global->__pyx_kp_s__23
#define __pyx_kp_u__23 __pyx_mstate_global->__pyx_kp_u__23
#define __pyx_kp_u__24 __pyx_mstate_global->__pyx_kp_u__24
#define __pyx_kp_b__3 __pyx_mstate_global->__pyx_kp_b__3
#define __pyx_kp_s__3 __pyx_mstate_global->__pyx_kp_s__3
#define __pyx_kp_u__30 __pyx_mstate_global->__pyx_kp_u__30
#define __pyx_kp_u__31 __pyx_mstate_global->__pyx_kp_u__31
#define __pyx_kp_s__32 __pyx_mstate_global->__pyx_kp_s__32
#define __pyx_kp_s__33 __pyx_mstate_global->__pyx_kp_s__33
#define __pyx_kp_u__34 __pyx_mstate_global->__pyx_kp_u__34
#define __pyx_kp_u__35 __pyx_mstate_global->__pyx_kp_u__35
#define __pyx_kp_u__39 __pyx_mstate_global->__pyx_kp_u__39
#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4
#define __pyx_kp_u__42 __pyx_mstate_global->__pyx_kp_u__42
#define __pyx_kp_u__44 __pyx_mstate_global->__pyx_kp_u__44
#define __pyx_kp_u__45 __pyx_mstate_global->__pyx_kp_u__45
#define __pyx_kp_u__48 __pyx_mstate_global->__pyx_kp_u__48
#define __pyx_kp_u__49 __pyx_mstate_global->__pyx_kp_u__49
#define __pyx_kp_u__50 __pyx_mstate_global->__pyx_kp_u__50
#define __pyx_kp_b__68 __pyx_mstate_global->__pyx_kp_b__68
#define __pyx_kp_b__69 __pyx_mstate_global->__pyx_kp_b__69
#define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8
#define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9
#define __pyx_kp_s_abcdefghijklmnopqrstuvwxyzABCDE __pyx_mstate_global->__pyx_kp_s_abcdefghijklmnopqrstuvwxyzABCDE
#define __pyx_n_s_accept __pyx_mstate_global->__pyx_n_s_accept
#define __pyx_n_s_active __pyx_mstate_global->__pyx_n_s_active
#define __pyx_n_s_add __pyx_mstate_global->__pyx_n_s_add
#define __pyx_n_s_addr __pyx_mstate_global->__pyx_n_s_addr
#define __pyx_n_s_alarm __pyx_mstate_global->__pyx_n_s_alarm
#define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all
#define __pyx_n_s_allow_chars __pyx_mstate_global->__pyx_n_s_allow_chars
#define __pyx_n_s_already __pyx_mstate_global->__pyx_n_s_already
#define __pyx_n_s_already_2 __pyx_mstate_global->__pyx_n_s_already_2
#define __pyx_n_s_amount __pyx_mstate_global->__pyx_n_s_amount
#define __pyx_kp_u_and_status __pyx_mstate_global->__pyx_kp_u_and_status
#define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append
#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args
#define __pyx_n_s_asyncio __pyx_mstate_global->__pyx_n_s_asyncio
#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
#define __pyx_n_s_asyncio_tasks __pyx_mstate_global->__pyx_n_s_asyncio_tasks
#define __pyx_n_s_attempt __pyx_mstate_global->__pyx_n_s_attempt
#define __pyx_n_s_attempts __pyx_mstate_global->__pyx_n_s_attempts
#define __pyx_n_s_auto_commit __pyx_mstate_global->__pyx_n_s_auto_commit
#define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b
#define __pyx_n_s_bind __pyx_mstate_global->__pyx_n_s_bind
#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool
#define __pyx_n_s_bucket __pyx_mstate_global->__pyx_n_s_bucket
#define __pyx_n_s_bucket_client __pyx_mstate_global->__pyx_n_s_bucket_client
#define __pyx_n_s_buelon __pyx_mstate_global->__pyx_n_s_buelon
#define __pyx_n_s_buelon_bucket __pyx_mstate_global->__pyx_n_s_buelon_bucket
#define __pyx_n_s_buelon_core_pipe_debug __pyx_mstate_global->__pyx_n_s_buelon_core_pipe_debug
#define __pyx_n_s_buelon_core_pipe_interpreter __pyx_mstate_global->__pyx_n_s_buelon_core_pipe_interpreter
#define __pyx_n_s_buelon_core_step __pyx_mstate_global->__pyx_n_s_buelon_core_step
#define __pyx_kp_s_buelon_core_step_Step __pyx_mstate_global->__pyx_kp_s_buelon_core_step_Step
#define __pyx_kp_s_buelon_core_step_StepStatus __pyx_mstate_global->__pyx_kp_s_buelon_core_step_StepStatus
#define __pyx_kp_s_buelon_core_step_Step_None __pyx_mstate_global->__pyx_kp_s_buelon_core_step_Step_None
#define __pyx_n_s_buelon_cython_c_hub __pyx_mstate_global->__pyx_n_s_buelon_cython_c_hub
#define __pyx_kp_s_buelon_cython_c_hub_pyx __pyx_mstate_global->__pyx_kp_s_buelon_cython_c_hub_pyx
#define __pyx_n_s_buelon_helpers_json_parser __pyx_mstate_global->__pyx_n_s_buelon_helpers_json_parser
#define __pyx_n_s_buelon_helpers_lazy_load_class __pyx_mstate_global->__pyx_n_s_buelon_helpers_lazy_load_class
#define __pyx_n_s_buelon_status_map __pyx_mstate_global->__pyx_n_s_buelon_status_map
#define __pyx_kp_u_buj_left_join_buelon_status_map __pyx_mstate_global->__pyx_kp_u_buj_left_join_buelon_status_map
#define __pyx_n_s_bulk __pyx_mstate_global->__pyx_n_s_bulk
#define __pyx_n_s_bulk_get __pyx_mstate_global->__pyx_n_s_bulk_get
#define __pyx_n_s_bulk_get_data __pyx_mstate_global->__pyx_n_s_bulk_get_data
#define __pyx_n_s_bulk_get_step __pyx_mstate_global->__pyx_n_s_bulk_get_step
#define __pyx_n_s_bulk_set __pyx_mstate_global->__pyx_n_s_bulk_set
#define __pyx_n_s_bulk_set_data __pyx_mstate_global->__pyx_n_s_bulk_set_data
#define __pyx_n_s_bytes __pyx_mstate_global->__pyx_n_s_bytes
#define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c
#define __pyx_kp_s_callable_None __pyx_mstate_global->__pyx_kp_s_callable_None
#define __pyx_n_s_cancel __pyx_mstate_global->__pyx_n_s_cancel
#define __pyx_n_s_cancel_2 __pyx_mstate_global->__pyx_n_s_cancel_2
#define __pyx_n_s_cancels __pyx_mstate_global->__pyx_n_s_cancels
#define __pyx_n_s_case_statement __pyx_mstate_global->__pyx_n_s_case_statement
#define __pyx_n_s_check_active_state __pyx_mstate_global->__pyx_n_s_check_active_state
#define __pyx_n_s_check_to_delete_bucket_files __pyx_mstate_global->__pyx_n_s_check_to_delete_bucket_files
#define __pyx_n_s_check_to_delete_bucket_files_2 __pyx_mstate_global->__pyx_n_s_check_to_delete_bucket_files_2
#define __pyx_n_s_child __pyx_mstate_global->__pyx_n_s_child
#define __pyx_n_s_children __pyx_mstate_global->__pyx_n_s_children
#define __pyx_n_s_children_params __pyx_mstate_global->__pyx_n_s_children_params
#define __pyx_n_s_chunk __pyx_mstate_global->__pyx_n_s_chunk
#define __pyx_n_s_chunk_size __pyx_mstate_global->__pyx_n_s_chunk_size
#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
#define __pyx_n_s_clean_query_string __pyx_mstate_global->__pyx_n_s_clean_query_string
#define __pyx_n_s_clear __pyx_mstate_global->__pyx_n_s_clear
#define __pyx_n_s_client __pyx_mstate_global->__pyx_n_s_client
#define __pyx_n_s_client_socket __pyx_mstate_global->__pyx_n_s_client_socket
#define __pyx_n_s_client_thread __pyx_mstate_global->__pyx_n_s_client_thread
#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close
#define __pyx_n_s_code __pyx_mstate_global->__pyx_n_s_code
#define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections
#define __pyx_n_s_commit __pyx_mstate_global->__pyx_n_s_commit
#define __pyx_n_s_concurrent_futures __pyx_mstate_global->__pyx_n_s_concurrent_futures
#define __pyx_n_s_config __pyx_mstate_global->__pyx_n_s_config
#define __pyx_n_s_conn __pyx_mstate_global->__pyx_n_s_conn
#define __pyx_n_s_connect __pyx_mstate_global->__pyx_n_s_connect
#define __pyx_n_s_connection_queue __pyx_mstate_global->__pyx_n_s_connection_queue
#define __pyx_n_s_core __pyx_mstate_global->__pyx_n_s_core
#define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count
#define __pyx_kp_s_count_must_be_an_integer __pyx_mstate_global->__pyx_kp_s_count_must_be_an_integer
#define __pyx_n_s_create_db_pool __pyx_mstate_global->__pyx_n_s_create_db_pool
#define __pyx_kp_s_create_index_if_not_exists_idx_b __pyx_mstate_global->__pyx_kp_s_create_index_if_not_exists_idx_b
#define __pyx_kp_s_create_index_if_not_exists_idx_b_2 __pyx_mstate_global->__pyx_kp_s_create_index_if_not_exists_idx_b_2
#define __pyx_kp_s_create_index_if_not_exists_idx_b_3 __pyx_mstate_global->__pyx_kp_s_create_index_if_not_exists_idx_b_3
#define __pyx_kp_s_create_index_if_not_exists_idx_b_4 __pyx_mstate_global->__pyx_kp_s_create_index_if_not_exists_idx_b_4
#define __pyx_kp_s_create_table_bue_session_ids_id __pyx_mstate_global->__pyx_kp_s_create_table_bue_session_ids_id
#define __pyx_kp_s_create_table_if_not_exists_buelo __pyx_mstate_global->__pyx_kp_s_create_table_if_not_exists_buelo
#define __pyx_n_s_cur __pyx_mstate_global->__pyx_n_s_cur
#define __pyx_n_s_cursor __pyx_mstate_global->__pyx_n_s_cursor
#define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d
#define __pyx_n_s_daemon __pyx_mstate_global->__pyx_n_s_daemon
#define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data
#define __pyx_kp_s_database_db __pyx_mstate_global->__pyx_kp_s_database_db
#define __pyx_n_s_db __pyx_mstate_global->__pyx_n_s_db
#define __pyx_n_s_db_operation __pyx_mstate_global->__pyx_n_s_db_operation
#define __pyx_n_s_db_path __pyx_mstate_global->__pyx_n_s_db_path
#define __pyx_n_s_db_pool __pyx_mstate_global->__pyx_n_s_db_pool
#define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode
#define __pyx_n_s_decrement_tag_usage __pyx_mstate_global->__pyx_n_s_decrement_tag_usage
#define __pyx_n_s_default __pyx_mstate_global->__pyx_n_s_default
#define __pyx_n_s_defaultdict __pyx_mstate_global->__pyx_n_s_defaultdict
#define __pyx_n_s_delete __pyx_mstate_global->__pyx_n_s_delete
#define __pyx_kp_u_delete_from_bue_session_ids_wher __pyx_mstate_global->__pyx_kp_u_delete_from_bue_session_ids_wher
#define __pyx_kp_s_delete_from_buelon_jobs __pyx_mstate_global->__pyx_kp_s_delete_from_buelon_jobs
#define __pyx_kp_s_delete_from_steps __pyx_mstate_global->__pyx_kp_s_delete_from_steps
#define __pyx_n_s_delete_last_line __pyx_mstate_global->__pyx_n_s_delete_last_line
#define __pyx_kp_b_delete_steps __pyx_mstate_global->__pyx_kp_b_delete_steps
#define __pyx_kp_s_delete_steps __pyx_mstate_global->__pyx_kp_s_delete_steps
#define __pyx_n_s_delete_steps_2 __pyx_mstate_global->__pyx_n_s_delete_steps_2
#define __pyx_n_s_delete_steps_3 __pyx_mstate_global->__pyx_n_s_delete_steps_3
#define __pyx_n_s_desc __pyx_mstate_global->__pyx_n_s_desc
#define __pyx_n_s_description __pyx_mstate_global->__pyx_n_s_description
#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
#define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2
#define __pyx_kp_s_dict_str_Any __pyx_mstate_global->__pyx_kp_s_dict_str_Any
#define __pyx_kp_s_dict_str_buelon_core_step_Step_N __pyx_mstate_global->__pyx_kp_s_dict_str_buelon_core_step_Step_N
#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc
#define __pyx_n_s_done __pyx_mstate_global->__pyx_n_s_done
#define __pyx_n_s_done_2 __pyx_mstate_global->__pyx_n_s_done_2
#define __pyx_n_s_dones __pyx_mstate_global->__pyx_n_s_dones
#define __pyx_n_s_dotenv __pyx_mstate_global->__pyx_n_s_dotenv
#define __pyx_n_s_download_table __pyx_mstate_global->__pyx_n_s_download_table
#define __pyx_kp_s_drop_table_bue_session_ids __pyx_mstate_global->__pyx_kp_s_drop_table_bue_session_ids
#define __pyx_kp_s_drop_table_if_exists_bue_session __pyx_mstate_global->__pyx_kp_s_drop_table_if_exists_bue_session
#define __pyx_n_s_dumps __pyx_mstate_global->__pyx_n_s_dumps
#define __pyx_n_s_e __pyx_mstate_global->__pyx_n_s_e
#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
#define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode
#define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end
#define __pyx_n_s_endswith __pyx_mstate_global->__pyx_n_s_endswith
#define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter
#define __pyx_n_s_enum __pyx_mstate_global->__pyx_n_s_enum
#define __pyx_kp_s_env __pyx_mstate_global->__pyx_kp_s_env
#define __pyx_n_s_environ __pyx_mstate_global->__pyx_n_s_environ
#define __pyx_kp_u_epoch __pyx_mstate_global->__pyx_kp_u_epoch
#define __pyx_kp_u_epoch_WHERE_id __pyx_mstate_global->__pyx_kp_u_epoch_WHERE_id
#define __pyx_kp_u_epoch_WHERE_id_IN __pyx_mstate_global->__pyx_kp_u_epoch_WHERE_id_IN
#define __pyx_kp_u_epoch_msg_trace_WHERE_id __pyx_mstate_global->__pyx_kp_u_epoch_msg_trace_WHERE_id
#define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error
#define __pyx_n_s_error_2 __pyx_mstate_global->__pyx_n_s_error_2
#define __pyx_kp_u_error_3 __pyx_mstate_global->__pyx_kp_u_error_3
#define __pyx_n_s_error_size __pyx_mstate_global->__pyx_n_s_error_size
#define __pyx_n_s_error_size_query __pyx_mstate_global->__pyx_n_s_error_size_query
#define __pyx_n_s_errors __pyx_mstate_global->__pyx_n_s_errors
#define __pyx_n_s_exc __pyx_mstate_global->__pyx_n_s_exc
#define __pyx_n_s_exc_tb __pyx_mstate_global->__pyx_n_s_exc_tb
#define __pyx_n_s_exc_type __pyx_mstate_global->__pyx_n_s_exc_type
#define __pyx_n_s_exc_val __pyx_mstate_global->__pyx_n_s_exc_val
#define __pyx_n_s_exclude __pyx_mstate_global->__pyx_n_s_exclude
#define __pyx_kp_s_exclude_must_be_a_list_of_string __pyx_mstate_global->__pyx_kp_s_exclude_must_be_a_list_of_string
#define __pyx_kp_s_exclude_must_be_a_string_or_a_li __pyx_mstate_global->__pyx_kp_s_exclude_must_be_a_string_or_a_li
#define __pyx_n_s_exclude_query __pyx_mstate_global->__pyx_n_s_exclude_query
#define __pyx_n_s_execute __pyx_mstate_global->__pyx_n_s_execute
#define __pyx_n_s_execute_batch __pyx_mstate_global->__pyx_n_s_execute_batch
#define __pyx_n_s_execute_db_query __pyx_mstate_global->__pyx_n_s_execute_db_query
#define __pyx_n_s_execute_request __pyx_mstate_global->__pyx_n_s_execute_request
#define __pyx_n_s_execute_transaction __pyx_mstate_global->__pyx_n_s_execute_transaction
#define __pyx_n_s_executing __pyx_mstate_global->__pyx_n_s_executing
#define __pyx_n_s_execution_queue __pyx_mstate_global->__pyx_n_s_execution_queue
#define __pyx_n_s_executor_thread __pyx_mstate_global->__pyx_n_s_executor_thread
#define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit
#define __pyx_n_s_exit_2 __pyx_mstate_global->__pyx_n_s_exit_2
#define __pyx_n_s_expiration_time __pyx_mstate_global->__pyx_n_s_expiration_time
#define __pyx_n_s_extras __pyx_mstate_global->__pyx_n_s_extras
#define __pyx_n_s_f __pyx_mstate_global->__pyx_n_s_f
#define __pyx_n_s_fail __pyx_mstate_global->__pyx_n_s_fail
#define __pyx_n_b_false __pyx_mstate_global->__pyx_n_b_false
#define __pyx_n_s_false __pyx_mstate_global->__pyx_n_s_false
#define __pyx_n_s_fetch_errors __pyx_mstate_global->__pyx_n_s_fetch_errors
#define __pyx_kp_s_fetch_errors_2 __pyx_mstate_global->__pyx_kp_s_fetch_errors_2
#define __pyx_n_s_fetch_errors_3 __pyx_mstate_global->__pyx_n_s_fetch_errors_3
#define __pyx_n_s_fetch_errors_locals_clean_query __pyx_mstate_global->__pyx_n_s_fetch_errors_locals_clean_query
#define __pyx_n_s_fetch_errors_locals_clean_query_2 __pyx_mstate_global->__pyx_n_s_fetch_errors_locals_clean_query_2
#define __pyx_n_s_fetch_errors_locals_genexpr __pyx_mstate_global->__pyx_n_s_fetch_errors_locals_genexpr
#define __pyx_kp_s_fetch_rows __pyx_mstate_global->__pyx_kp_s_fetch_rows
#define __pyx_n_s_fetchall __pyx_mstate_global->__pyx_n_s_fetchall
#define __pyx_n_s_file_path __pyx_mstate_global->__pyx_n_s_file_path
#define __pyx_n_s_finished_statuses __pyx_mstate_global->__pyx_n_s_finished_statuses
#define __pyx_n_s_first_iteration __pyx_mstate_global->__pyx_n_s_first_iteration
#define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format
#define __pyx_n_s_frame __pyx_mstate_global->__pyx_n_s_frame
#define __pyx_n_s_from_json __pyx_mstate_global->__pyx_n_s_from_json
#define __pyx_n_s_func __pyx_mstate_global->__pyx_n_s_func
#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
#define __pyx_n_s_generate_steps_from_code __pyx_mstate_global->__pyx_n_s_generate_steps_from_code
#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr
#define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get
#define __pyx_n_s_get_data __pyx_mstate_global->__pyx_n_s_get_data
#define __pyx_n_s_get_job_statuses __pyx_mstate_global->__pyx_n_s_get_job_statuses
#define __pyx_n_s_get_job_statuses_locals_genexpr __pyx_mstate_global->__pyx_n_s_get_job_statuses_locals_genexpr
#define __pyx_n_s_get_postgres_from_env __pyx_mstate_global->__pyx_n_s_get_postgres_from_env
#define __pyx_n_s_get_queue __pyx_mstate_global->__pyx_n_s_get_queue
#define __pyx_n_s_get_rows __pyx_mstate_global->__pyx_n_s_get_rows
#define __pyx_n_s_get_statuses __pyx_mstate_global->__pyx_n_s_get_statuses
#define __pyx_n_s_get_step __pyx_mstate_global->__pyx_n_s_get_step
#define __pyx_n_s_get_step_count __pyx_mstate_global->__pyx_n_s_get_step_count
#define __pyx_n_s_get_step_count_2 __pyx_mstate_global->__pyx_n_s_get_step_count_2
#define __pyx_n_s_get_step_status __pyx_mstate_global->__pyx_n_s_get_step_status
#define __pyx_n_s_get_steps __pyx_mstate_global->__pyx_n_s_get_steps
#define __pyx_kp_s_get_steps_2 __pyx_mstate_global->__pyx_kp_s_get_steps_2
#define __pyx_n_s_getattr __pyx_mstate_global->__pyx_n_s_getattr
#define __pyx_kp_u_group_by_status __pyx_mstate_global->__pyx_kp_u_group_by_status
#define __pyx_kp_u_group_by_status_2 __pyx_mstate_global->__pyx_kp_u_group_by_status_2
#define __pyx_n_s_handle_client __pyx_mstate_global->__pyx_n_s_handle_client
#define __pyx_n_s_handler __pyx_mstate_global->__pyx_n_s_handler
#define __pyx_n_s_headers __pyx_mstate_global->__pyx_n_s_headers
#define __pyx_n_s_helpers __pyx_mstate_global->__pyx_n_s_helpers
#define __pyx_n_s_host __pyx_mstate_global->__pyx_n_s_host
#define __pyx_n_s_hub __pyx_mstate_global->__pyx_n_s_hub
#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
#define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id
#define __pyx_kp_u_id_2 __pyx_mstate_global->__pyx_kp_u_id_2
#define __pyx_kp_u_id_IN __pyx_mstate_global->__pyx_kp_u_id_IN
#define __pyx_n_s_id_column __pyx_mstate_global->__pyx_n_s_id_column
#define __pyx_kp_s_id_in __pyx_mstate_global->__pyx_kp_s_id_in
#define __pyx_n_s_ids __pyx_mstate_global->__pyx_n_s_ids
#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
#define __pyx_n_s_include_workers __pyx_mstate_global->__pyx_n_s_include_workers
#define __pyx_n_s_include_working __pyx_mstate_global->__pyx_n_s_include_working
#define __pyx_n_s_increments __pyx_mstate_global->__pyx_n_s_increments
#define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init
#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass
#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
#define __pyx_kp_u_insert_into_bue_session_ids_id_a __pyx_mstate_global->__pyx_kp_u_insert_into_bue_session_ids_id_a
#define __pyx_n_s_inspect __pyx_mstate_global->__pyx_n_s_inspect
#define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int
#define __pyx_kp_s_int_float __pyx_mstate_global->__pyx_kp_s_int_float
#define __pyx_kp_s_int_float_Callable __pyx_mstate_global->__pyx_kp_s_int_float_Callable
#define __pyx_kp_u_is_already_in_use_Retrying __pyx_mstate_global->__pyx_kp_u_is_already_in_use_Retrying
#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
#define __pyx_n_s_item __pyx_mstate_global->__pyx_n_s_item
#define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items
#define __pyx_n_s_job __pyx_mstate_global->__pyx_n_s_job
#define __pyx_n_s_job_handler __pyx_mstate_global->__pyx_n_s_job_handler
#define __pyx_n_s_job_ids __pyx_mstate_global->__pyx_n_s_job_ids
#define __pyx_n_s_join __pyx_mstate_global->__pyx_n_s_join
#define __pyx_n_s_json_parser __pyx_mstate_global->__pyx_n_s_json_parser
#define __pyx_n_s_json_table __pyx_mstate_global->__pyx_n_s_json_table
#define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k
#define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key
#define __pyx_n_s_key_map __pyx_mstate_global->__pyx_n_s_key_map
#define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys
#define __pyx_n_s_kwargs __pyx_mstate_global->__pyx_n_s_kwargs
#define __pyx_n_s_lazy_load_class __pyx_mstate_global->__pyx_n_s_lazy_load_class
#define __pyx_n_s_lazy_steps __pyx_mstate_global->__pyx_n_s_lazy_steps
#define __pyx_n_s_limit __pyx_mstate_global->__pyx_n_s_limit
#define __pyx_n_s_list __pyx_mstate_global->__pyx_n_s_list
#define __pyx_kp_s_list_None __pyx_mstate_global->__pyx_kp_s_list_None
#define __pyx_kp_s_list_buelon_core_step_Step __pyx_mstate_global->__pyx_kp_s_list_buelon_core_step_Step
#define __pyx_kp_s_list_dict __pyx_mstate_global->__pyx_kp_s_list_dict
#define __pyx_kp_s_list_str __pyx_mstate_global->__pyx_kp_s_list_str
#define __pyx_kp_s_list_str_str_None __pyx_mstate_global->__pyx_kp_s_list_str_str_None
#define __pyx_n_s_listen __pyx_mstate_global->__pyx_n_s_listen
#define __pyx_n_s_load_db __pyx_mstate_global->__pyx_n_s_load_db
#define __pyx_n_s_load_dotenv __pyx_mstate_global->__pyx_n_s_load_dotenv
#define __pyx_n_s_load_pg __pyx_mstate_global->__pyx_n_s_load_pg
#define __pyx_n_s_loads __pyx_mstate_global->__pyx_n_s_loads
#define __pyx_n_s_local __pyx_mstate_global->__pyx_n_s_local
#define __pyx_n_s_localhost __pyx_mstate_global->__pyx_n_s_localhost
#define __pyx_kp_u_lower_msg_like __pyx_mstate_global->__pyx_kp_u_lower_msg_like
#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
#define __pyx_n_s_main_2 __pyx_mstate_global->__pyx_n_s_main_2
#define __pyx_n_s_max_connections __pyx_mstate_global->__pyx_n_s_max_connections
#define __pyx_n_s_max_reconnect_attempts __pyx_mstate_global->__pyx_n_s_max_reconnect_attempts
#define __pyx_n_s_max_workers __pyx_mstate_global->__pyx_n_s_max_workers
#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass
#define __pyx_n_s_method __pyx_mstate_global->__pyx_n_s_method
#define __pyx_n_s_min_table_size __pyx_mstate_global->__pyx_n_s_min_table_size
#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module
#define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries
#define __pyx_n_s_msg __pyx_mstate_global->__pyx_n_s_msg
#define __pyx_kp_u_msg_msg __pyx_mstate_global->__pyx_kp_u_msg_msg
#define __pyx_kp_u_msg_trace_trace __pyx_mstate_global->__pyx_kp_u_msg_trace_trace
#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
#define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
#define __pyx_n_s_new_bulk __pyx_mstate_global->__pyx_n_s_new_bulk
#define __pyx_n_s_new_key __pyx_mstate_global->__pyx_n_s_new_key
#define __pyx_n_s_new_output __pyx_mstate_global->__pyx_n_s_new_output
#define __pyx_n_b_nothing __pyx_mstate_global->__pyx_n_b_nothing
#define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset
#define __pyx_n_b_ok __pyx_mstate_global->__pyx_n_b_ok
#define __pyx_n_s_open __pyx_mstate_global->__pyx_n_s_open
#define __pyx_kp_u_or_epoch __pyx_mstate_global->__pyx_kp_u_or_epoch
#define __pyx_kp_u_or_status __pyx_mstate_global->__pyx_kp_u_or_status
#define __pyx_n_s_order_by __pyx_mstate_global->__pyx_n_s_order_by
#define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os
#define __pyx_n_s_output __pyx_mstate_global->__pyx_n_s_output
#define __pyx_n_s_p __pyx_mstate_global->__pyx_n_s_p
#define __pyx_n_s_params __pyx_mstate_global->__pyx_n_s_params
#define __pyx_n_s_parent __pyx_mstate_global->__pyx_n_s_parent
#define __pyx_n_s_parent_statuses __pyx_mstate_global->__pyx_n_s_parent_statuses
#define __pyx_n_s_parents __pyx_mstate_global->__pyx_n_s_parents
#define __pyx_n_s_path __pyx_mstate_global->__pyx_n_s_path
#define __pyx_n_s_payload __pyx_mstate_global->__pyx_n_s_payload
#define __pyx_n_s_pending __pyx_mstate_global->__pyx_n_s_pending
#define __pyx_n_s_pending_2 __pyx_mstate_global->__pyx_n_s_pending_2
#define __pyx_n_s_pendings __pyx_mstate_global->__pyx_n_s_pendings
#define __pyx_n_s_persistqueue __pyx_mstate_global->__pyx_n_s_persistqueue
#define __pyx_n_s_pipe_debug __pyx_mstate_global->__pyx_n_s_pipe_debug
#define __pyx_n_s_pipe_interpreter __pyx_mstate_global->__pyx_n_s_pipe_interpreter
#define __pyx_n_s_platform __pyx_mstate_global->__pyx_n_s_platform
#define __pyx_n_s_port __pyx_mstate_global->__pyx_n_s_port
#define __pyx_n_s_postgres __pyx_mstate_global->__pyx_n_s_postgres
#define __pyx_n_s_postgres_cancel __pyx_mstate_global->__pyx_n_s_postgres_cancel
#define __pyx_n_s_postgres_cancels __pyx_mstate_global->__pyx_n_s_postgres_cancels
#define __pyx_n_s_postgres_delete_steps __pyx_mstate_global->__pyx_n_s_postgres_delete_steps
#define __pyx_n_s_postgres_done __pyx_mstate_global->__pyx_n_s_postgres_done
#define __pyx_n_s_postgres_dones __pyx_mstate_global->__pyx_n_s_postgres_dones
#define __pyx_n_s_postgres_error __pyx_mstate_global->__pyx_n_s_postgres_error
#define __pyx_n_s_postgres_fetch_errors __pyx_mstate_global->__pyx_n_s_postgres_fetch_errors
#define __pyx_n_s_postgres_get_rows __pyx_mstate_global->__pyx_n_s_postgres_get_rows
#define __pyx_n_s_postgres_get_step_count __pyx_mstate_global->__pyx_n_s_postgres_get_step_count
#define __pyx_n_s_postgres_get_steps __pyx_mstate_global->__pyx_n_s_postgres_get_steps
#define __pyx_n_s_postgres_pending __pyx_mstate_global->__pyx_n_s_postgres_pending
#define __pyx_n_s_postgres_pendings __pyx_mstate_global->__pyx_n_s_postgres_pendings
#define __pyx_n_s_postgres_repair __pyx_mstate_global->__pyx_n_s_postgres_repair
#define __pyx_n_s_postgres_reset __pyx_mstate_global->__pyx_n_s_postgres_reset
#define __pyx_n_s_postgres_reset_errors __pyx_mstate_global->__pyx_n_s_postgres_reset_errors
#define __pyx_n_s_postgres_resets __pyx_mstate_global->__pyx_n_s_postgres_resets
#define __pyx_n_s_postgres_upload_step __pyx_mstate_global->__pyx_n_s_postgres_upload_step
#define __pyx_n_s_postgres_upload_steps __pyx_mstate_global->__pyx_n_s_postgres_upload_steps
#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare
#define __pyx_n_s_print __pyx_mstate_global->__pyx_n_s_print
#define __pyx_n_s_print_exc __pyx_mstate_global->__pyx_n_s_print_exc
#define __pyx_n_s_priority __pyx_mstate_global->__pyx_n_s_priority
#define __pyx_kp_s_priority_ASC_epoch __pyx_mstate_global->__pyx_kp_s_priority_ASC_epoch
#define __pyx_kp_s_priority_DESC_epoch __pyx_mstate_global->__pyx_kp_s_priority_DESC_epoch
#define __pyx_kp_s_priority_asc_epoch __pyx_mstate_global->__pyx_kp_s_priority_asc_epoch
#define __pyx_kp_s_priority_desc_epoch __pyx_mstate_global->__pyx_kp_s_priority_desc_epoch
#define __pyx_n_s_process_request __pyx_mstate_global->__pyx_n_s_process_request
#define __pyx_n_s_process_transactions __pyx_mstate_global->__pyx_n_s_process_transactions
#define __pyx_n_s_processing __pyx_mstate_global->__pyx_n_s_processing
#define __pyx_n_s_psycopg2 __pyx_mstate_global->__pyx_n_s_psycopg2
#define __pyx_n_s_put __pyx_mstate_global->__pyx_n_s_put
#define __pyx_n_s_q __pyx_mstate_global->__pyx_n_s_q
#define __pyx_n_s_qs __pyx_mstate_global->__pyx_n_s_qs
#define __pyx_n_s_qsize __pyx_mstate_global->__pyx_n_s_qsize
#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname
#define __pyx_n_s_query __pyx_mstate_global->__pyx_n_s_query
#define __pyx_n_s_query_string __pyx_mstate_global->__pyx_n_s_query_string
#define __pyx_n_s_queue __pyx_mstate_global->__pyx_n_s_queue
#define __pyx_n_s_queued __pyx_mstate_global->__pyx_n_s_queued
#define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r
#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
#define __pyx_n_s_read __pyx_mstate_global->__pyx_n_s_read
#define __pyx_n_s_receive __pyx_mstate_global->__pyx_n_s_receive
#define __pyx_n_s_received __pyx_mstate_global->__pyx_n_s_received
#define __pyx_n_s_recv __pyx_mstate_global->__pyx_n_s_recv
#define __pyx_n_s_remove_data __pyx_mstate_global->__pyx_n_s_remove_data
#define __pyx_n_s_remove_step __pyx_mstate_global->__pyx_n_s_remove_step
#define __pyx_n_s_repair __pyx_mstate_global->__pyx_n_s_repair
#define __pyx_n_s_request __pyx_mstate_global->__pyx_n_s_request
#define __pyx_n_s_reset __pyx_mstate_global->__pyx_n_s_reset
#define __pyx_n_s_reset_2 __pyx_mstate_global->__pyx_n_s_reset_2
#define __pyx_kp_b_reset_errors __pyx_mstate_global->__pyx_kp_b_reset_errors
#define __pyx_kp_s_reset_errors __pyx_mstate_global->__pyx_kp_s_reset_errors
#define __pyx_n_s_reset_errors_2 __pyx_mstate_global->__pyx_n_s_reset_errors_2
#define __pyx_n_s_reset_errors_3 __pyx_mstate_global->__pyx_n_s_reset_errors_3
#define __pyx_n_s_reset_tag_usage __pyx_mstate_global->__pyx_n_s_reset_tag_usage
#define __pyx_n_s_resets __pyx_mstate_global->__pyx_n_s_resets
#define __pyx_n_s_response __pyx_mstate_global->__pyx_n_s_response
#define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result
#define __pyx_n_s_retries __pyx_mstate_global->__pyx_n_s_retries
#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return
#define __pyx_n_s_return_job_def_id __pyx_mstate_global->__pyx_n_s_return_job_def_id
#define __pyx_n_s_return_job_ids __pyx_mstate_global->__pyx_n_s_return_job_ids
#define __pyx_n_s_reverse __pyx_mstate_global->__pyx_n_s_reverse
#define __pyx_n_s_row __pyx_mstate_global->__pyx_n_s_row
#define __pyx_n_s_rows __pyx_mstate_global->__pyx_n_s_rows
#define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s
#define __pyx_kp_u_s_scope __pyx_mstate_global->__pyx_kp_u_s_scope
#define __pyx_kp_u_s_scope_ANY_array __pyx_mstate_global->__pyx_kp_u_s_scope_ANY_array
#define __pyx_n_s_scope __pyx_mstate_global->__pyx_n_s_scope
#define __pyx_n_s_scope_section __pyx_mstate_global->__pyx_n_s_scope_section
#define __pyx_n_s_scopes __pyx_mstate_global->__pyx_n_s_scopes
#define __pyx_kp_u_seconds __pyx_mstate_global->__pyx_kp_u_seconds
#define __pyx_kp_u_select_buj_id_bsm_name_from_sel __pyx_mstate_global->__pyx_kp_u_select_buj_id_bsm_name_from_sel
#define __pyx_kp_u_select_count_as_amount_min_prior __pyx_mstate_global->__pyx_kp_u_select_count_as_amount_min_prior
#define __pyx_kp_s_select_from_buelon_jobs_where_st __pyx_mstate_global->__pyx_kp_s_select_from_buelon_jobs_where_st
#define __pyx_kp_s_select_id_attempts_from_bue_sess __pyx_mstate_global->__pyx_kp_s_select_id_attempts_from_bue_sess
#define __pyx_kp_u_select_id_status_from_buelon_job __pyx_mstate_global->__pyx_kp_u_select_id_status_from_buelon_job
#define __pyx_kp_u_select_max_priority_as_priority __pyx_mstate_global->__pyx_kp_u_select_max_priority_as_priority
#define __pyx_kp_u_select_status_count_as_amount_f __pyx_mstate_global->__pyx_kp_u_select_status_count_as_amount_f
#define __pyx_kp_u_select_status_count_as_amount_f_2 __pyx_mstate_global->__pyx_kp_u_select_status_count_as_amount_f_2
#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send
#define __pyx_n_s_send_request __pyx_mstate_global->__pyx_n_s_send_request
#define __pyx_n_s_sendall __pyx_mstate_global->__pyx_n_s_sendall
#define __pyx_n_s_server __pyx_mstate_global->__pyx_n_s_server
#define __pyx_n_s_set __pyx_mstate_global->__pyx_n_s_set
#define __pyx_kp_s_set_None __pyx_mstate_global->__pyx_kp_s_set_None
#define __pyx_n_s_set_data __pyx_mstate_global->__pyx_n_s_set_data
#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name
#define __pyx_n_s_set_step __pyx_mstate_global->__pyx_n_s_set_step
#define __pyx_n_s_set_steps __pyx_mstate_global->__pyx_n_s_set_steps
#define __pyx_n_s_setdefaulttimeout __pyx_mstate_global->__pyx_n_s_setdefaulttimeout
#define __pyx_n_s_setsockopt __pyx_mstate_global->__pyx_n_s_setsockopt
#define __pyx_n_s_settimeout __pyx_mstate_global->__pyx_n_s_settimeout
#define __pyx_n_s_should_finish __pyx_mstate_global->__pyx_n_s_should_finish
#define __pyx_n_s_shutdown __pyx_mstate_global->__pyx_n_s_shutdown
#define __pyx_n_s_signal __pyx_mstate_global->__pyx_n_s_signal
#define __pyx_kp_s_signal_only_works_in_main_thread __pyx_mstate_global->__pyx_kp_s_signal_only_works_in_main_thread
#define __pyx_n_s_signum __pyx_mstate_global->__pyx_n_s_signum
#define __pyx_n_s_sleep __pyx_mstate_global->__pyx_n_s_sleep
#define __pyx_n_s_socket __pyx_mstate_global->__pyx_n_s_socket
#define __pyx_kp_s_socket_socket __pyx_mstate_global->__pyx_kp_s_socket_socket
#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
#define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split
#define __pyx_n_s_sql __pyx_mstate_global->__pyx_n_s_sql
#define __pyx_n_s_sql_set_to_working __pyx_mstate_global->__pyx_n_s_sql_set_to_working
#define __pyx_n_s_sql_update_children __pyx_mstate_global->__pyx_n_s_sql_update_children
#define __pyx_n_s_sql_update_step __pyx_mstate_global->__pyx_n_s_sql_update_step
#define __pyx_n_s_sqlite3 __pyx_mstate_global->__pyx_n_s_sqlite3
#define __pyx_n_s_ss __pyx_mstate_global->__pyx_n_s_ss
#define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
#define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state
#define __pyx_kp_u_state_archived_WHERE __pyx_mstate_global->__pyx_kp_u_state_archived_WHERE
#define __pyx_kp_u_state_archived_WHERE_id __pyx_mstate_global->__pyx_kp_u_state_archived_WHERE_id
#define __pyx_kp_u_state_waiting_WHERE __pyx_mstate_global->__pyx_kp_u_state_waiting_WHERE
#define __pyx_kp_u_state_waiting_WHERE_id __pyx_mstate_global->__pyx_kp_u_state_waiting_WHERE_id
#define __pyx_n_s_status __pyx_mstate_global->__pyx_n_s_status
#define __pyx_n_s_status_value __pyx_mstate_global->__pyx_n_s_status_value
#define __pyx_n_s_status_values __pyx_mstate_global->__pyx_n_s_status_values
#define __pyx_n_s_statuses __pyx_mstate_global->__pyx_n_s_statuses
#define __pyx_n_s_stdout __pyx_mstate_global->__pyx_n_s_stdout
#define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step
#define __pyx_n_s_step_2 __pyx_mstate_global->__pyx_n_s_step_2
#define __pyx_kp_u_step_3 __pyx_mstate_global->__pyx_kp_u_step_3
#define __pyx_kp_b_step_count __pyx_mstate_global->__pyx_kp_b_step_count
#define __pyx_kp_s_step_count __pyx_mstate_global->__pyx_kp_s_step_count
#define __pyx_kp_u_step_data __pyx_mstate_global->__pyx_kp_u_step_data
#define __pyx_n_s_step_id __pyx_mstate_global->__pyx_n_s_step_id
#define __pyx_n_s_step_ids __pyx_mstate_global->__pyx_n_s_step_ids
#define __pyx_n_s_step_json __pyx_mstate_global->__pyx_n_s_step_json
#define __pyx_n_s_step_jsons __pyx_mstate_global->__pyx_n_s_step_jsons
#define __pyx_n_s_steps __pyx_mstate_global->__pyx_n_s_steps
#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str
#define __pyx_kp_s_str_None __pyx_mstate_global->__pyx_kp_s_str_None
#define __pyx_kp_s_str_list_str_None __pyx_mstate_global->__pyx_kp_s_str_list_str_None
#define __pyx_kp_s_str_list_str_tuple_str_list_str __pyx_mstate_global->__pyx_kp_s_str_list_str_tuple_str_list_str
#define __pyx_n_s_string __pyx_mstate_global->__pyx_n_s_string
#define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip
#define __pyx_n_s_submit __pyx_mstate_global->__pyx_n_s_submit
#define __pyx_kp_u_submit_jobs __pyx_mstate_global->__pyx_kp_u_submit_jobs
#define __pyx_n_s_submit_pipe_code __pyx_mstate_global->__pyx_n_s_submit_pipe_code
#define __pyx_n_s_submit_pipe_code_from_file __pyx_mstate_global->__pyx_n_s_submit_pipe_code_from_file
#define __pyx_n_s_success __pyx_mstate_global->__pyx_n_s_success
#define __pyx_n_s_suffix __pyx_mstate_global->__pyx_n_s_suffix
#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super
#define __pyx_n_s_sync __pyx_mstate_global->__pyx_n_s_sync
#define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys
#define __pyx_n_s_system __pyx_mstate_global->__pyx_n_s_system
#define __pyx_n_s_table __pyx_mstate_global->__pyx_n_s_table
#define __pyx_n_s_tag __pyx_mstate_global->__pyx_n_s_tag
#define __pyx_n_s_tag_lock __pyx_mstate_global->__pyx_n_s_tag_lock
#define __pyx_n_s_tag_usage __pyx_mstate_global->__pyx_n_s_tag_usage
#define __pyx_n_s_tag_velocities __pyx_mstate_global->__pyx_n_s_tag_velocities
#define __pyx_n_s_target __pyx_mstate_global->__pyx_n_s_target
#define __pyx_n_s_task_done __pyx_mstate_global->__pyx_n_s_task_done
#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
#define __pyx_n_s_thread __pyx_mstate_global->__pyx_n_s_thread
#define __pyx_n_s_threading __pyx_mstate_global->__pyx_n_s_threading
#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw
#define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time
#define __pyx_n_s_timeout __pyx_mstate_global->__pyx_n_s_timeout
#define __pyx_n_s_timeout_duration __pyx_mstate_global->__pyx_n_s_timeout_duration
#define __pyx_n_s_timeout_func __pyx_mstate_global->__pyx_n_s_timeout_func
#define __pyx_n_s_timeout_func_locals_CustomTimeou __pyx_mstate_global->__pyx_n_s_timeout_func_locals_CustomTimeou
#define __pyx_n_s_timeout_func_locals_handler __pyx_mstate_global->__pyx_n_s_timeout_func_locals_handler
#define __pyx_n_s_to_json __pyx_mstate_global->__pyx_n_s_to_json
#define __pyx_n_s_total __pyx_mstate_global->__pyx_n_s_total
#define __pyx_n_s_tqdm __pyx_mstate_global->__pyx_n_s_tqdm
#define __pyx_n_s_trace __pyx_mstate_global->__pyx_n_s_trace
#define __pyx_kp_u_trace_state_waiting_WHERE_id __pyx_mstate_global->__pyx_kp_u_trace_state_waiting_WHERE_id
#define __pyx_n_s_traceback __pyx_mstate_global->__pyx_n_s_traceback
#define __pyx_n_s_transaction_queue __pyx_mstate_global->__pyx_n_s_transaction_queue
#define __pyx_n_b_true __pyx_mstate_global->__pyx_n_b_true
#define __pyx_n_s_true __pyx_mstate_global->__pyx_n_s_true
#define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types
#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing
#define __pyx_n_s_unsync __pyx_mstate_global->__pyx_n_s_unsync
#define __pyx_kp_u_update_bue_session_ids_set_attem __pyx_mstate_global->__pyx_kp_u_update_bue_session_ids_set_attem
#define __pyx_kp_u_update_buelon_jobs_set_status __pyx_mstate_global->__pyx_kp_u_update_buelon_jobs_set_status
#define __pyx_n_s_update_params __pyx_mstate_global->__pyx_n_s_update_params
#define __pyx_n_s_update_query __pyx_mstate_global->__pyx_n_s_update_query
#define __pyx_kp_u_update_steps_set_status __pyx_mstate_global->__pyx_kp_u_update_steps_set_status
#define __pyx_n_s_upload_pipe_code __pyx_mstate_global->__pyx_n_s_upload_pipe_code
#define __pyx_n_s_upload_pipe_code_from_file __pyx_mstate_global->__pyx_n_s_upload_pipe_code_from_file
#define __pyx_n_s_upload_pipe_code_locals_genexpr __pyx_mstate_global->__pyx_n_s_upload_pipe_code_locals_genexpr
#define __pyx_kp_b_upload_step __pyx_mstate_global->__pyx_kp_b_upload_step
#define __pyx_kp_s_upload_step __pyx_mstate_global->__pyx_kp_s_upload_step
#define __pyx_n_s_upload_step_2 __pyx_mstate_global->__pyx_n_s_upload_step_2
#define __pyx_n_s_upload_step_3 __pyx_mstate_global->__pyx_n_s_upload_step_3
#define __pyx_n_s_upload_steps __pyx_mstate_global->__pyx_n_s_upload_steps
#define __pyx_n_s_upload_steps_2 __pyx_mstate_global->__pyx_n_s_upload_steps_2
#define __pyx_kp_s_upload_steps_3 __pyx_mstate_global->__pyx_kp_s_upload_steps_3
#define __pyx_n_s_upload_table __pyx_mstate_global->__pyx_n_s_upload_table
#define __pyx_n_s_uuid __pyx_mstate_global->__pyx_n_s_uuid
#define __pyx_n_s_uuid1 __pyx_mstate_global->__pyx_n_s_uuid1
#define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v
#define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value
#define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values
#define __pyx_n_s_velocity __pyx_mstate_global->__pyx_n_s_velocity
#define __pyx_n_s_velocity_sql __pyx_mstate_global->__pyx_n_s_velocity_sql
#define __pyx_n_s_wait_until_finish __pyx_mstate_global->__pyx_n_s_wait_until_finish
#define __pyx_n_s_waiting __pyx_mstate_global->__pyx_n_s_waiting
#define __pyx_n_s_waiting_priority __pyx_mstate_global->__pyx_n_s_waiting_priority
#define __pyx_n_s_warn __pyx_mstate_global->__pyx_n_s_warn
#define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings
#define __pyx_n_s_where __pyx_mstate_global->__pyx_n_s_where
#define __pyx_kp_u_where_status __pyx_mstate_global->__pyx_kp_u_where_status
#define __pyx_kp_u_where_status_2 __pyx_mstate_global->__pyx_kp_u_where_status_2
#define __pyx_kp_u_where_status_not_in __pyx_mstate_global->__pyx_kp_u_where_status_not_in
#define __pyx_kp_u_where_status_not_in_2 __pyx_mstate_global->__pyx_kp_u_where_status_not_in_2
#define __pyx_n_s_worker __pyx_mstate_global->__pyx_n_s_worker
#define __pyx_n_s_worker_thread __pyx_mstate_global->__pyx_n_s_worker_thread
#define __pyx_n_s_working __pyx_mstate_global->__pyx_n_s_working
#define __pyx_n_s_working_clause __pyx_mstate_global->__pyx_n_s_working_clause
#define __pyx_n_s_write __pyx_mstate_global->__pyx_n_s_write
#define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip
#define __pyx_float_5_ __pyx_mstate_global->__pyx_float_5_
#define __pyx_float_10_ __pyx_mstate_global->__pyx_float_10_
#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
#define __pyx_int_2 __pyx_mstate_global->__pyx_int_2
#define __pyx_int_3 __pyx_mstate_global->__pyx_int_3
#define __pyx_int_4 __pyx_mstate_global->__pyx_int_4
#define __pyx_int_5 __pyx_mstate_global->__pyx_int_5
#define __pyx_int_10 __pyx_mstate_global->__pyx_int_10
#define __pyx_int_30 __pyx_mstate_global->__pyx_int_30
#define __pyx_int_50 __pyx_mstate_global->__pyx_int_50
#define __pyx_int_60 __pyx_mstate_global->__pyx_int_60
#define __pyx_int_100 __pyx_mstate_global->__pyx_int_100
#define __pyx_int_600 __pyx_mstate_global->__pyx_int_600
#define __pyx_int_1000 __pyx_mstate_global->__pyx_int_1000
#define __pyx_int_1024 __pyx_mstate_global->__pyx_int_1024
#define __pyx_int_2000 __pyx_mstate_global->__pyx_int_2000
#define __pyx_int_65432 __pyx_mstate_global->__pyx_int_65432
#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_
#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5
#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6
#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7
#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17
#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
#define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19
#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25
#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26
#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27
#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28
#define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36
#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37
#define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40
#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41
#define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43
#define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46
#define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52
#define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53
#define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55
#define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57
#define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58
#define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59
#define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60
#define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61
#define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62
#define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63
#define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64
#define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65
#define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66
#define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67
#define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71
#define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73
#define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74
#define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76
#define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78
#define __pyx_tuple__80 __pyx_mstate_global->__pyx_tuple__80
#define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82
#define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84
#define __pyx_tuple__86 __pyx_mstate_global->__pyx_tuple__86
#define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87
#define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89
#define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90
#define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92
#define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93
#define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95
#define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97
#define __pyx_tuple__99 __pyx_mstate_global->__pyx_tuple__99
#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2
#define __pyx_tuple__101 __pyx_mstate_global->__pyx_tuple__101
#define __pyx_tuple__103 __pyx_mstate_global->__pyx_tuple__103
#define __pyx_tuple__104 __pyx_mstate_global->__pyx_tuple__104
#define __pyx_tuple__106 __pyx_mstate_global->__pyx_tuple__106
#define __pyx_tuple__107 __pyx_mstate_global->__pyx_tuple__107
#define __pyx_tuple__109 __pyx_mstate_global->__pyx_tuple__109
#define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111
#define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113
#define __pyx_tuple__115 __pyx_mstate_global->__pyx_tuple__115
#define __pyx_tuple__117 __pyx_mstate_global->__pyx_tuple__117
#define __pyx_tuple__119 __pyx_mstate_global->__pyx_tuple__119
#define __pyx_tuple__121 __pyx_mstate_global->__pyx_tuple__121
#define __pyx_tuple__123 __pyx_mstate_global->__pyx_tuple__123
#define __pyx_tuple__125 __pyx_mstate_global->__pyx_tuple__125
#define __pyx_tuple__127 __pyx_mstate_global->__pyx_tuple__127
#define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129
#define __pyx_tuple__131 __pyx_mstate_global->__pyx_tuple__131
#define __pyx_tuple__133 __pyx_mstate_global->__pyx_tuple__133
#define __pyx_tuple__134 __pyx_mstate_global->__pyx_tuple__134
#define __pyx_tuple__136 __pyx_mstate_global->__pyx_tuple__136
#define __pyx_tuple__138 __pyx_mstate_global->__pyx_tuple__138
#define __pyx_tuple__140 __pyx_mstate_global->__pyx_tuple__140
#define __pyx_tuple__142 __pyx_mstate_global->__pyx_tuple__142
#define __pyx_tuple__144 __pyx_mstate_global->__pyx_tuple__144
#define __pyx_tuple__146 __pyx_mstate_global->__pyx_tuple__146
#define __pyx_tuple__148 __pyx_mstate_global->__pyx_tuple__148
#define __pyx_tuple__150 __pyx_mstate_global->__pyx_tuple__150
#define __pyx_tuple__152 __pyx_mstate_global->__pyx_tuple__152
#define __pyx_tuple__155 __pyx_mstate_global->__pyx_tuple__155
#define __pyx_tuple__157 __pyx_mstate_global->__pyx_tuple__157
#define __pyx_tuple__159 __pyx_mstate_global->__pyx_tuple__159
#define __pyx_tuple__161 __pyx_mstate_global->__pyx_tuple__161
#define __pyx_tuple__166 __pyx_mstate_global->__pyx_tuple__166
#define __pyx_tuple__168 __pyx_mstate_global->__pyx_tuple__168
#define __pyx_tuple__169 __pyx_mstate_global->__pyx_tuple__169
#define __pyx_tuple__171 __pyx_mstate_global->__pyx_tuple__171
#define __pyx_tuple__172 __pyx_mstate_global->__pyx_tuple__172
#define __pyx_tuple__174 __pyx_mstate_global->__pyx_tuple__174
#define __pyx_tuple__175 __pyx_mstate_global->__pyx_tuple__175
#define __pyx_tuple__177 __pyx_mstate_global->__pyx_tuple__177
#define __pyx_tuple__179 __pyx_mstate_global->__pyx_tuple__179
#define __pyx_tuple__181 __pyx_mstate_global->__pyx_tuple__181
#define __pyx_tuple__183 __pyx_mstate_global->__pyx_tuple__183
#define __pyx_tuple__185 __pyx_mstate_global->__pyx_tuple__185
#define __pyx_tuple__187 __pyx_mstate_global->__pyx_tuple__187
#define __pyx_tuple__189 __pyx_mstate_global->__pyx_tuple__189
#define __pyx_tuple__191 __pyx_mstate_global->__pyx_tuple__191
#define __pyx_tuple__193 __pyx_mstate_global->__pyx_tuple__193
#define __pyx_tuple__197 __pyx_mstate_global->__pyx_tuple__197
#define __pyx_tuple__199 __pyx_mstate_global->__pyx_tuple__199
#define __pyx_tuple__201 __pyx_mstate_global->__pyx_tuple__201
#define __pyx_tuple__204 __pyx_mstate_global->__pyx_tuple__204
#define __pyx_tuple__212 __pyx_mstate_global->__pyx_tuple__212
#define __pyx_tuple__214 __pyx_mstate_global->__pyx_tuple__214
#define __pyx_tuple__216 __pyx_mstate_global->__pyx_tuple__216
#define __pyx_tuple__218 __pyx_mstate_global->__pyx_tuple__218
#define __pyx_tuple__220 __pyx_mstate_global->__pyx_tuple__220
#define __pyx_tuple__223 __pyx_mstate_global->__pyx_tuple__223
#define __pyx_tuple__225 __pyx_mstate_global->__pyx_tuple__225
#define __pyx_tuple__227 __pyx_mstate_global->__pyx_tuple__227
#define __pyx_tuple__229 __pyx_mstate_global->__pyx_tuple__229
#define __pyx_tuple__231 __pyx_mstate_global->__pyx_tuple__231
#define __pyx_tuple__233 __pyx_mstate_global->__pyx_tuple__233
#define __pyx_tuple__235 __pyx_mstate_global->__pyx_tuple__235
#define __pyx_tuple__237 __pyx_mstate_global->__pyx_tuple__237
#define __pyx_tuple__239 __pyx_mstate_global->__pyx_tuple__239
#define __pyx_tuple__241 __pyx_mstate_global->__pyx_tuple__241
#define __pyx_tuple__243 __pyx_mstate_global->__pyx_tuple__243
#define __pyx_tuple__245 __pyx_mstate_global->__pyx_tuple__245
#define __pyx_tuple__247 __pyx_mstate_global->__pyx_tuple__247
#define __pyx_tuple__249 __pyx_mstate_global->__pyx_tuple__249
#define __pyx_tuple__252 __pyx_mstate_global->__pyx_tuple__252
#define __pyx_tuple__254 __pyx_mstate_global->__pyx_tuple__254
#define __pyx_tuple__256 __pyx_mstate_global->__pyx_tuple__256
#define __pyx_tuple__258 __pyx_mstate_global->__pyx_tuple__258
#define __pyx_tuple__260 __pyx_mstate_global->__pyx_tuple__260
#define __pyx_tuple__262 __pyx_mstate_global->__pyx_tuple__262
#define __pyx_tuple__265 __pyx_mstate_global->__pyx_tuple__265
#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29
#define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38
#define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47
#define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51
#define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54
#define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56
#define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70
#define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72
#define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75
#define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77
#define __pyx_codeobj__79 __pyx_mstate_global->__pyx_codeobj__79
#define __pyx_codeobj__81 __pyx_mstate_global->__pyx_codeobj__81
#define __pyx_codeobj__83 __pyx_mstate_global->__pyx_codeobj__83
#define __pyx_codeobj__85 __pyx_mstate_global->__pyx_codeobj__85
#define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88
#define __pyx_codeobj__91 __pyx_mstate_global->__pyx_codeobj__91
#define __pyx_codeobj__94 __pyx_mstate_global->__pyx_codeobj__94
#define __pyx_codeobj__96 __pyx_mstate_global->__pyx_codeobj__96
#define __pyx_codeobj__98 __pyx_mstate_global->__pyx_codeobj__98
#define __pyx_codeobj__100 __pyx_mstate_global->__pyx_codeobj__100
#define __pyx_codeobj__102 __pyx_mstate_global->__pyx_codeobj__102
#define __pyx_codeobj__105 __pyx_mstate_global->__pyx_codeobj__105
#define __pyx_codeobj__108 __pyx_mstate_global->__pyx_codeobj__108
#define __pyx_codeobj__110 __pyx_mstate_global->__pyx_codeobj__110
#define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112
#define __pyx_codeobj__114 __pyx_mstate_global->__pyx_codeobj__114
#define __pyx_codeobj__116 __pyx_mstate_global->__pyx_codeobj__116
#define __pyx_codeobj__118 __pyx_mstate_global->__pyx_codeobj__118
#define __pyx_codeobj__120 __pyx_mstate_global->__pyx_codeobj__120
#define __pyx_codeobj__122 __pyx_mstate_global->__pyx_codeobj__122
#define __pyx_codeobj__124 __pyx_mstate_global->__pyx_codeobj__124
#define __pyx_codeobj__126 __pyx_mstate_global->__pyx_codeobj__126
#define __pyx_codeobj__128 __pyx_mstate_global->__pyx_codeobj__128
#define __pyx_codeobj__130 __pyx_mstate_global->__pyx_codeobj__130
#define __pyx_codeobj__132 __pyx_mstate_global->__pyx_codeobj__132
#define __pyx_codeobj__135 __pyx_mstate_global->__pyx_codeobj__135
#define __pyx_codeobj__137 __pyx_mstate_global->__pyx_codeobj__137
#define __pyx_codeobj__139 __pyx_mstate_global->__pyx_codeobj__139
#define __pyx_codeobj__141 __pyx_mstate_global->__pyx_codeobj__141
#define __pyx_codeobj__143 __pyx_mstate_global->__pyx_codeobj__143
#define __pyx_codeobj__145 __pyx_mstate_global->__pyx_codeobj__145
#define __pyx_codeobj__147 __pyx_mstate_global->__pyx_codeobj__147
#define __pyx_codeobj__149 __pyx_mstate_global->__pyx_codeobj__149
#define __pyx_codeobj__151 __pyx_mstate_global->__pyx_codeobj__151
#define __pyx_codeobj__153 __pyx_mstate_global->__pyx_codeobj__153
#define __pyx_codeobj__154 __pyx_mstate_global->__pyx_codeobj__154
#define __pyx_codeobj__156 __pyx_mstate_global->__pyx_codeobj__156
#define __pyx_codeobj__158 __pyx_mstate_global->__pyx_codeobj__158
#define __pyx_codeobj__160 __pyx_mstate_global->__pyx_codeobj__160
#define __pyx_codeobj__162 __pyx_mstate_global->__pyx_codeobj__162
#define __pyx_codeobj__163 __pyx_mstate_global->__pyx_codeobj__163
#define __pyx_codeobj__164 __pyx_mstate_global->__pyx_codeobj__164
#define __pyx_codeobj__165 __pyx_mstate_global->__pyx_codeobj__165
#define __pyx_codeobj__167 __pyx_mstate_global->__pyx_codeobj__167
#define __pyx_codeobj__170 __pyx_mstate_global->__pyx_codeobj__170
#define __pyx_codeobj__173 __pyx_mstate_global->__pyx_codeobj__173
#define __pyx_codeobj__176 __pyx_mstate_global->__pyx_codeobj__176
#define __pyx_codeobj__178 __pyx_mstate_global->__pyx_codeobj__178
#define __pyx_codeobj__180 __pyx_mstate_global->__pyx_codeobj__180
#define __pyx_codeobj__182 __pyx_mstate_global->__pyx_codeobj__182
#define __pyx_codeobj__184 __pyx_mstate_global->__pyx_codeobj__184
#define __pyx_codeobj__186 __pyx_mstate_global->__pyx_codeobj__186
#define __pyx_codeobj__188 __pyx_mstate_global->__pyx_codeobj__188
#define __pyx_codeobj__190 __pyx_mstate_global->__pyx_codeobj__190
#define __pyx_codeobj__192 __pyx_mstate_global->__pyx_codeobj__192
#define __pyx_codeobj__194 __pyx_mstate_global->__pyx_codeobj__194
#define __pyx_codeobj__195 __pyx_mstate_global->__pyx_codeobj__195
#define __pyx_codeobj__196 __pyx_mstate_global->__pyx_codeobj__196
#define __pyx_codeobj__198 __pyx_mstate_global->__pyx_codeobj__198
#define __pyx_codeobj__200 __pyx_mstate_global->__pyx_codeobj__200
#define __pyx_codeobj__202 __pyx_mstate_global->__pyx_codeobj__202
#define __pyx_codeobj__203 __pyx_mstate_global->__pyx_codeobj__203
#define __pyx_codeobj__205 __pyx_mstate_global->__pyx_codeobj__205
#define __pyx_codeobj__206 __pyx_mstate_global->__pyx_codeobj__206
#define __pyx_codeobj__207 __pyx_mstate_global->__pyx_codeobj__207
#define __pyx_codeobj__208 __pyx_mstate_global->__pyx_codeobj__208
#define __pyx_codeobj__209 __pyx_mstate_global->__pyx_codeobj__209
#define __pyx_codeobj__210 __pyx_mstate_global->__pyx_codeobj__210
#define __pyx_codeobj__211 __pyx_mstate_global->__pyx_codeobj__211
#define __pyx_codeobj__213 __pyx_mstate_global->__pyx_codeobj__213
#define __pyx_codeobj__215 __pyx_mstate_global->__pyx_codeobj__215
#define __pyx_codeobj__217 __pyx_mstate_global->__pyx_codeobj__217
#define __pyx_codeobj__219 __pyx_mstate_global->__pyx_codeobj__219
#define __pyx_codeobj__221 __pyx_mstate_global->__pyx_codeobj__221
#define __pyx_codeobj__222 __pyx_mstate_global->__pyx_codeobj__222
#define __pyx_codeobj__224 __pyx_mstate_global->__pyx_codeobj__224
#define __pyx_codeobj__226 __pyx_mstate_global->__pyx_codeobj__226
#define __pyx_codeobj__228 __pyx_mstate_global->__pyx_codeobj__228
#define __pyx_codeobj__230 __pyx_mstate_global->__pyx_codeobj__230
#define __pyx_codeobj__232 __pyx_mstate_global->__pyx_codeobj__232
#define __pyx_codeobj__234 __pyx_mstate_global->__pyx_codeobj__234
#define __pyx_codeobj__236 __pyx_mstate_global->__pyx_codeobj__236
#define __pyx_codeobj__238 __pyx_mstate_global->__pyx_codeobj__238
#define __pyx_codeobj__240 __pyx_mstate_global->__pyx_codeobj__240
#define __pyx_codeobj__242 __pyx_mstate_global->__pyx_codeobj__242
#define __pyx_codeobj__244 __pyx_mstate_global->__pyx_codeobj__244
#define __pyx_codeobj__246 __pyx_mstate_global->__pyx_codeobj__246
#define __pyx_codeobj__248 __pyx_mstate_global->__pyx_codeobj__248
#define __pyx_codeobj__250 __pyx_mstate_global->__pyx_codeobj__250
#define __pyx_codeobj__251 __pyx_mstate_global->__pyx_codeobj__251
#define __pyx_codeobj__253 __pyx_mstate_global->__pyx_codeobj__253
#define __pyx_codeobj__255 __pyx_mstate_global->__pyx_codeobj__255
#define __pyx_codeobj__257 __pyx_mstate_global->__pyx_codeobj__257
#define __pyx_codeobj__259 __pyx_mstate_global->__pyx_codeobj__259
#define __pyx_codeobj__261 __pyx_mstate_global->__pyx_codeobj__261
#define __pyx_codeobj__263 __pyx_mstate_global->__pyx_codeobj__263
#define __pyx_codeobj__264 __pyx_mstate_global->__pyx_codeobj__264
#define __pyx_codeobj__266 __pyx_mstate_global->__pyx_codeobj__266
/* #### Code section: module_code ### */

/* "buelon/cython/c_hub.pyx":74
 * 
 * 
 * def delete_last_line():             # <<<<<<<<<<<<<<
 *     sys.stdout.write("\033[F")
 *     sys.stdout.write("\033[K")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_1delete_last_line(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_1delete_last_line = {"delete_last_line", (PyCFunction)__pyx_pw_6buelon_6cython_5c_hub_1delete_last_line, METH_NOARGS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_1delete_last_line(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_last_line (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_delete_last_line(__pyx_self);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_delete_last_line(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete_last_line", 1);

  /* "buelon/cython/c_hub.pyx":75
 * 
 * def delete_last_line():
 *     sys.stdout.write("\033[F")             # <<<<<<<<<<<<<<
 *     sys.stdout.write("\033[K")
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_F};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __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;

  /* "buelon/cython/c_hub.pyx":76
 * def delete_last_line():
 *     sys.stdout.write("\033[F")
 *     sys.stdout.write("\033[K")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_K};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __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;

  /* "buelon/cython/c_hub.pyx":74
 * 
 * 
 * def delete_last_line():             # <<<<<<<<<<<<<<
 *     sys.stdout.write("\033[F")
 *     sys.stdout.write("\033[K")
 */

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

/* "buelon/cython/c_hub.pyx":79
 * 
 * 
 * def timeout_func(func, args=None, kwargs=None, timeout_duration=1, default=None):             # <<<<<<<<<<<<<<
 *     if args is None: args = []
 *     if kwargs is None: kwargs = {}
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_3timeout_func(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_3timeout_func = {"timeout_func", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_3timeout_func, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_3timeout_func(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_v_timeout_duration = 0;
  PyObject *__pyx_v_default = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timeout_func (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_timeout_duration,&__pyx_n_s_default,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1)));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_func)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kwargs);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout_duration);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_default);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "timeout_func") < 0)) __PYX_ERR(0, 79, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_func = values[0];
    __pyx_v_args = values[1];
    __pyx_v_kwargs = values[2];
    __pyx_v_timeout_duration = values[3];
    __pyx_v_default = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("timeout_func", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 79, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.timeout_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_2timeout_func(__pyx_self, __pyx_v_func, __pyx_v_args, __pyx_v_kwargs, __pyx_v_timeout_duration, __pyx_v_default);

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

/* "buelon/cython/c_hub.pyx":91
 *         pass
 * 
 *     def handler(signum, frame):             # <<<<<<<<<<<<<<
 *         raise CustomTimeoutError()
 * 
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_12timeout_func_handler(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_signum, CYTHON_UNUSED PyObject *__pyx_v_frame) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func *__pyx_cur_scope;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handler", 1);
  __pyx_outer_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "buelon/cython/c_hub.pyx":92
 * 
 *     def handler(signum, frame):
 *         raise CustomTimeoutError()             # <<<<<<<<<<<<<<
 * 
 *     # set the timeout handler
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_CustomTimeoutError)) { __Pyx_RaiseClosureNameError("CustomTimeoutError"); __PYX_ERR(0, 92, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_cur_scope->__pyx_v_CustomTimeoutError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __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, 92, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":91
 *         pass
 * 
 *     def handler(signum, frame):             # <<<<<<<<<<<<<<
 *         raise CustomTimeoutError()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("buelon.cython.c_hub.timeout_func.handler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":79
 * 
 * 
 * def timeout_func(func, args=None, kwargs=None, timeout_duration=1, default=None):             # <<<<<<<<<<<<<<
 *     if args is None: args = []
 *     if kwargs is None: kwargs = {}
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_2timeout_func(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_timeout_duration, PyObject *__pyx_v_default) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func *__pyx_cur_scope;
  PyObject *__pyx_v_handler = 0;
  PyObject *__pyx_v_result = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_exc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  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;
  char const *__pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("timeout_func", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 79, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_INCREF(__pyx_v_kwargs);

  /* "buelon/cython/c_hub.pyx":80
 * 
 * def timeout_func(func, args=None, kwargs=None, timeout_duration=1, default=None):
 *     if args is None: args = []             # <<<<<<<<<<<<<<
 *     if kwargs is None: kwargs = {}
 * 
 */
  __pyx_t_1 = (__pyx_v_args == Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "buelon/cython/c_hub.pyx":81
 * def timeout_func(func, args=None, kwargs=None, timeout_duration=1, default=None):
 *     if args is None: args = []
 *     if kwargs is None: kwargs = {}             # <<<<<<<<<<<<<<
 * 
 *     # only Darwin, Linux
 */
  __pyx_t_1 = (__pyx_v_kwargs == Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "buelon/cython/c_hub.pyx":84
 * 
 *     # only Darwin, Linux
 *     if platform.system() == 'Windows':             # <<<<<<<<<<<<<<
 *         # does not work in windows
 *         return func(*args, **kwargs)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_platform); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_system); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_Windows, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":86
 *     if platform.system() == 'Windows':
 *         # does not work in windows
 *         return func(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     class CustomTimeoutError(Exception):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(0, 86, __pyx_L1_error)
    }
    if (likely(PyDict_CheckExact(__pyx_v_kwargs))) {
      __pyx_t_4 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":84
 * 
 *     # only Darwin, Linux
 *     if platform.system() == 'Windows':             # <<<<<<<<<<<<<<
 *         # does not work in windows
 *         return func(*args, **kwargs)
 */
  }

  /* "buelon/cython/c_hub.pyx":88
 *         return func(*args, **kwargs)
 * 
 *     class CustomTimeoutError(Exception):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]));
  __Pyx_GIVEREF((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])))) __PYX_ERR(0, 88, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_4, __pyx_n_s_CustomTimeoutError, __pyx_n_s_timeout_func_locals_CustomTimeou, (PyObject *) NULL, __pyx_n_s_buelon_cython_c_hub, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4 != __pyx_t_3) {
    if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 88, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_CustomTimeoutError, __pyx_t_4, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_CustomTimeoutError = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":91
 *         pass
 * 
 *     def handler(signum, frame):             # <<<<<<<<<<<<<<
 *         raise CustomTimeoutError()
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_12timeout_func_1handler, 0, __pyx_n_s_timeout_func_locals_handler, ((PyObject*)__pyx_cur_scope), __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_handler = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":95
 * 
 *     # set the timeout handler
 *     signal.signal(signal.SIGALRM, handler)             # <<<<<<<<<<<<<<
 *     signal.alarm(timeout_duration)
 *     try:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_signal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signal); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_signal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SIGALRM); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_v_handler};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":96
 *     # set the timeout handler
 *     signal.signal(signal.SIGALRM, handler)
 *     signal.alarm(timeout_duration)             # <<<<<<<<<<<<<<
 *     try:
 *         result = func(*args, **kwargs)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_signal); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_alarm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_timeout_duration};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __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;

  /* "buelon/cython/c_hub.pyx":97
 *     signal.signal(signal.SIGALRM, handler)
 *     signal.alarm(timeout_duration)
 *     try:             # <<<<<<<<<<<<<<
 *         result = func(*args, **kwargs)
 *     except CustomTimeoutError as exc:
 */
  /*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:*/ {

        /* "buelon/cython/c_hub.pyx":98
 *     signal.alarm(timeout_duration)
 *     try:
 *         result = func(*args, **kwargs)             # <<<<<<<<<<<<<<
 *     except CustomTimeoutError as exc:
 *         result = default
 */
        __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
          __PYX_ERR(0, 98, __pyx_L9_error)
        }
        if (likely(PyDict_CheckExact(__pyx_v_kwargs))) {
          __pyx_t_3 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_3);
        } else {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_func, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_result = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "buelon/cython/c_hub.pyx":97
 *     signal.signal(signal.SIGALRM, handler)
 *     signal.alarm(timeout_duration)
 *     try:             # <<<<<<<<<<<<<<
 *         result = func(*args, **kwargs)
 *     except CustomTimeoutError as exc:
 */
      }
      __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_L14_try_end;
      __pyx_L9_error:;
      __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;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "buelon/cython/c_hub.pyx":99
 *     try:
 *         result = func(*args, **kwargs)
 *     except CustomTimeoutError as exc:             # <<<<<<<<<<<<<<
 *         result = default
 *     finally:
 */
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_cur_scope->__pyx_v_CustomTimeoutError);
      if (__pyx_t_10) {
        __Pyx_AddTraceback("buelon.cython.c_hub.timeout_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 99, __pyx_L11_except_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_v_exc = __pyx_t_3;
        /*try:*/ {

          /* "buelon/cython/c_hub.pyx":100
 *         result = func(*args, **kwargs)
 *     except CustomTimeoutError as exc:
 *         result = default             # <<<<<<<<<<<<<<
 *     finally:
 *         signal.alarm(0)
 */
          __Pyx_INCREF(__pyx_v_default);
          __Pyx_XDECREF_SET(__pyx_v_result, __pyx_v_default);
        }

        /* "buelon/cython/c_hub.pyx":99
 *     try:
 *         result = func(*args, **kwargs)
 *     except CustomTimeoutError as exc:             # <<<<<<<<<<<<<<
 *         result = default
 *     finally:
 */
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_exc); __pyx_v_exc = 0;
            goto __pyx_L21;
          }
          __pyx_L21:;
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L10_exception_handled;
      }
      goto __pyx_L11_except_error;

      /* "buelon/cython/c_hub.pyx":97
 *     signal.signal(signal.SIGALRM, handler)
 *     signal.alarm(timeout_duration)
 *     try:             # <<<<<<<<<<<<<<
 *         result = func(*args, **kwargs)
 *     except CustomTimeoutError as exc:
 */
      __pyx_L11_except_error:;
      __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_L7_error;
      __pyx_L10_exception_handled:;
      __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_L14_try_end:;
    }
  }

  /* "buelon/cython/c_hub.pyx":102
 *         result = default
 *     finally:
 *         signal.alarm(0)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  /*finally:*/ {
    /*normal exit:*/{
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_signal); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_alarm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_5 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_5 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_0};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L8;
    }
    __pyx_L7_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 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;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
      {
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_signal); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 102, __pyx_L23_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_alarm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L23_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (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;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_int_0};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
      }
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
      __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
      goto __pyx_L1_error;
      __pyx_L23_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L8:;
  }

  /* "buelon/cython/c_hub.pyx":104
 *         signal.alarm(0)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":79
 * 
 * 
 * def timeout_func(func, args=None, kwargs=None, timeout_duration=1, default=None):             # <<<<<<<<<<<<<<
 *     if args is None: args = []
 *     if kwargs is None: kwargs = {}
 */

  /* 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("buelon.cython.c_hub.timeout_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_handler);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_exc);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":107
 * 
 * 
 * def receive(conn: socket.socket) -> bytes:             # <<<<<<<<<<<<<<
 *     data = b''
 *     while not data.endswith(PIPELINE_END_TOKEN):
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_4receive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_conn) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_v = 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;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_UCS4 __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("receive", 1);

  /* "buelon/cython/c_hub.pyx":108
 * 
 * def receive(conn: socket.socket) -> bytes:
 *     data = b''             # <<<<<<<<<<<<<<
 *     while not data.endswith(PIPELINE_END_TOKEN):
 *         v = conn.recv(1024)
 */
  __Pyx_INCREF(__pyx_kp_b__3);
  __pyx_v_data = __pyx_kp_b__3;

  /* "buelon/cython/c_hub.pyx":109
 * def receive(conn: socket.socket) -> bytes:
 *     data = b''
 *     while not data.endswith(PIPELINE_END_TOKEN):             # <<<<<<<<<<<<<<
 *         v = conn.recv(1024)
 *         data += v
 */
  while (1) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PIPELINE_END_TOKEN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 109, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = (!__pyx_t_6);
    if (!__pyx_t_7) break;

    /* "buelon/cython/c_hub.pyx":110
 *     data = b''
 *     while not data.endswith(PIPELINE_END_TOKEN):
 *         v = conn.recv(1024)             # <<<<<<<<<<<<<<
 *         data += v
 *         if not v and not data.endswith(PIPELINE_END_TOKEN):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_recv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_1024};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":111
 *     while not data.endswith(PIPELINE_END_TOKEN):
 *         v = conn.recv(1024)
 *         data += v             # <<<<<<<<<<<<<<
 *         if not v and not data.endswith(PIPELINE_END_TOKEN):
 *             try:
 */
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_data, __pyx_v_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":112
 *         v = conn.recv(1024)
 *         data += v
 *         if not v and not data.endswith(PIPELINE_END_TOKEN):             # <<<<<<<<<<<<<<
 *             try:
 *                 data = data.decode()
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_v); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 112, __pyx_L1_error)
    __pyx_t_8 = (!__pyx_t_6);
    if (__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PIPELINE_END_TOKEN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (!__pyx_t_8);
    __pyx_t_7 = __pyx_t_6;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_7) {

      /* "buelon/cython/c_hub.pyx":113
 *         data += v
 *         if not v and not data.endswith(PIPELINE_END_TOKEN):
 *             try:             # <<<<<<<<<<<<<<
 *                 data = data.decode()
 *             except: pass
 */
      {
        __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:*/ {

          /* "buelon/cython/c_hub.pyx":114
 *         if not v and not data.endswith(PIPELINE_END_TOKEN):
 *             try:
 *                 data = data.decode()             # <<<<<<<<<<<<<<
 *             except: pass
 *             raise ValueError(f'Invalid value received: `{data}`')
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
            __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "buelon/cython/c_hub.pyx":113
 *         data += v
 *         if not v and not data.endswith(PIPELINE_END_TOKEN):
 *             try:             # <<<<<<<<<<<<<<
 *                 data = data.decode()
 *             except: pass
 */
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L15_try_end;
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_t_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;

        /* "buelon/cython/c_hub.pyx":115
 *             try:
 *                 data = data.decode()
 *             except: pass             # <<<<<<<<<<<<<<
 *             raise ValueError(f'Invalid value received: `{data}`')
 *     return data[:-LENGTH_OF_PIPELINE_END_TOKEN]
 */
        /*except:*/ {
          __Pyx_ErrRestore(0,0,0);
          goto __pyx_L9_exception_handled;
        }
        __pyx_L9_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_L15_try_end:;
      }

      /* "buelon/cython/c_hub.pyx":116
 *                 data = data.decode()
 *             except: pass
 *             raise ValueError(f'Invalid value received: `{data}`')             # <<<<<<<<<<<<<<
 *     return data[:-LENGTH_OF_PIPELINE_END_TOKEN]
 * 
 */
      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = 0;
      __pyx_t_13 = 127;
      __Pyx_INCREF(__pyx_kp_u_Invalid_value_received);
      __pyx_t_12 += 25;
      __Pyx_GIVEREF(__pyx_kp_u_Invalid_value_received);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Invalid_value_received);
      __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_data, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_13;
      __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_kp_u__4);
      __pyx_t_12 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__4);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__4);
      __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 116, __pyx_L1_error)

      /* "buelon/cython/c_hub.pyx":112
 *         v = conn.recv(1024)
 *         data += v
 *         if not v and not data.endswith(PIPELINE_END_TOKEN):             # <<<<<<<<<<<<<<
 *             try:
 *                 data = data.decode()
 */
    }
  }

  /* "buelon/cython/c_hub.pyx":117
 *             except: pass
 *             raise ValueError(f'Invalid value received: `{data}`')
 *     return data[:-LENGTH_OF_PIPELINE_END_TOKEN]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_LENGTH_OF_PIPELINE_END_TOKEN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_data, 0, 0, NULL, &__pyx_t_2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(0, 117, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":107
 * 
 * 
 * def receive(conn: socket.socket) -> bytes:             # <<<<<<<<<<<<<<
 *     data = b''
 *     while not data.endswith(PIPELINE_END_TOKEN):
 */

  /* 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("buelon.cython.c_hub.receive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":120
 * 
 * 
 * def send(conn: socket.socket, data: bytes) -> None:             # <<<<<<<<<<<<<<
 *     conn.sendall(data+PIPELINE_END_TOKEN)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_7send(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_7send = {"send", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_7send, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_7send(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_conn = 0;
  PyObject *__pyx_v_data = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_conn,&__pyx_n_s_data,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_conn)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("send", 1, 2, 2, 1); __PYX_ERR(0, 120, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "send") < 0)) __PYX_ERR(0, 120, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_conn = values[0];
    __pyx_v_data = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("send", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 120, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.send", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 0, "data", 1))) __PYX_ERR(0, 120, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_6send(__pyx_self, __pyx_v_conn, __pyx_v_data);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_6send(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_conn, 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;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send", 1);

  /* "buelon/cython/c_hub.pyx":121
 * 
 * def send(conn: socket.socket, data: bytes) -> None:
 *     conn.sendall(data+PIPELINE_END_TOKEN)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_sendall); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PIPELINE_END_TOKEN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Add(__pyx_v_data, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __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;

  /* "buelon/cython/c_hub.pyx":120
 * 
 * 
 * def send(conn: socket.socket, data: bytes) -> None:             # <<<<<<<<<<<<<<
 *     conn.sendall(data+PIPELINE_END_TOKEN)
 * 
 */

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

/* "buelon/cython/c_hub.pyx":124
 * 
 * 
 * def load_db():             # <<<<<<<<<<<<<<
 *     with sqlite3.connect(db_path) as conn:
 *         cur = conn.cursor()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9load_db(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9load_db = {"load_db", (PyCFunction)__pyx_pw_6buelon_6cython_5c_hub_9load_db, METH_NOARGS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9load_db(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_db (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_8load_db(__pyx_self);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_8load_db(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_conn = NULL;
  PyObject *__pyx_v_cur = 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;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("load_db", 1);

  /* "buelon/cython/c_hub.pyx":125
 * 
 * def load_db():
 *     with sqlite3.connect(db_path) as conn:             # <<<<<<<<<<<<<<
 *         cur = conn.cursor()
 *         cur.execute('PRAGMA journal_mode=WAL')
 */
  /*with:*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sqlite3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_connect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_db_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_2 = __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_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_conn = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":126
 * def load_db():
 *     with sqlite3.connect(db_path) as conn:
 *         cur = conn.cursor()             # <<<<<<<<<<<<<<
 *         cur.execute('PRAGMA journal_mode=WAL')
 *         cur.execute('CREATE TABLE IF NOT EXISTS steps ('
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_cursor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __pyx_v_cur = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":127
 *     with sqlite3.connect(db_path) as conn:
 *         cur = conn.cursor()
 *         cur.execute('PRAGMA journal_mode=WAL')             # <<<<<<<<<<<<<<
 *         cur.execute('CREATE TABLE IF NOT EXISTS steps ('
 *                     'id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace);')
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_PRAGMA_journal_mode_WAL};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":128
 *         cur = conn.cursor()
 *         cur.execute('PRAGMA journal_mode=WAL')
 *         cur.execute('CREATE TABLE IF NOT EXISTS steps ('             # <<<<<<<<<<<<<<
 *                     'id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace);')
 *         cur.execute('CREATE UNIQUE INDEX IF NOT EXISTS idx_steps_id ON steps (id);')
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_steps};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":130
 *         cur.execute('CREATE TABLE IF NOT EXISTS steps ('
 *                     'id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace);')
 *         cur.execute('CREATE UNIQUE INDEX IF NOT EXISTS idx_steps_id ON steps (id);')             # <<<<<<<<<<<<<<
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_status ON steps (status);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_priority ON steps (priority);')
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_CREATE_UNIQUE_INDEX_IF_NOT_EXIST};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":131
 *                     'id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace);')
 *         cur.execute('CREATE UNIQUE INDEX IF NOT EXISTS idx_steps_id ON steps (id);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_status ON steps (status);')             # <<<<<<<<<<<<<<
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_priority ON steps (priority);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_scope ON steps (scope);')
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":132
 *         cur.execute('CREATE UNIQUE INDEX IF NOT EXISTS idx_steps_id ON steps (id);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_status ON steps (status);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_priority ON steps (priority);')             # <<<<<<<<<<<<<<
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_scope ON steps (scope);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_epoch ON steps (epoch);')
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_2};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":133
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_status ON steps (status);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_priority ON steps (priority);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_scope ON steps (scope);')             # <<<<<<<<<<<<<<
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_epoch ON steps (epoch);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_tag ON steps (tag);')
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_3};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":134
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_priority ON steps (priority);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_scope ON steps (scope);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_epoch ON steps (epoch);')             # <<<<<<<<<<<<<<
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_tag ON steps (tag);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_velocity ON steps (velocity);')
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_4};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":135
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_scope ON steps (scope);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_epoch ON steps (epoch);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_tag ON steps (tag);')             # <<<<<<<<<<<<<<
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_velocity ON steps (velocity);')
 * 
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_5};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":136
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_epoch ON steps (epoch);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_tag ON steps (tag);')
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_velocity ON steps (velocity);')             # <<<<<<<<<<<<<<
 * 
 *         cur.execute('CREATE TABLE IF NOT EXISTS tags ('
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_6};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":138
 *         cur.execute('CREATE INDEX IF NOT EXISTS idx_steps_velocity ON steps (velocity);')
 * 
 *         cur.execute('CREATE TABLE IF NOT EXISTS tags ('             # <<<<<<<<<<<<<<
 *                     'tag, velocity);')
 *         conn.commit()
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":140
 *         cur.execute('CREATE TABLE IF NOT EXISTS tags ('
 *                     'tag, velocity);')
 *         conn.commit()             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_commit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":125
 * 
 * def load_db():
 *     with sqlite3.connect(db_path) as conn:             # <<<<<<<<<<<<<<
 *         cur = conn.cursor()
 *         cur.execute('PRAGMA journal_mode=WAL')
 */
        }
        __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_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("buelon.cython.c_hub.load_db", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 125, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_3);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L9_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, 125, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_11 < 0) __PYX_ERR(0, 125, __pyx_L9_except_error)
          __pyx_t_12 = (!__pyx_t_11);
          if (unlikely(__pyx_t_12)) {
            __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, 125, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __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_L8_exception_handled:;
        __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_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__5, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 125, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "buelon/cython/c_hub.pyx":124
 * 
 * 
 * def load_db():             # <<<<<<<<<<<<<<
 *     with sqlite3.connect(db_path) as conn:
 *         cur = conn.cursor()
 */

  /* 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("buelon.cython.c_hub.load_db", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_conn);
  __Pyx_XDECREF(__pyx_v_cur);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":143
 * 
 * 
 * def delete_steps():             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_11delete_steps(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_11delete_steps = {"delete_steps", (PyCFunction)__pyx_pw_6buelon_6cython_5c_hub_11delete_steps, METH_NOARGS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_11delete_steps(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_steps (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_10delete_steps(__pyx_self);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_10delete_steps(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_WORKER_HOST = NULL;
  PyObject *__pyx_v_WORKER_PORT = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_v_data = 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;
  unsigned 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;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete_steps", 1);

  /* "buelon/cython/c_hub.pyx":144
 * 
 * def delete_steps():
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')             # <<<<<<<<<<<<<<
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_WORKER_HOST = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":145
 * def delete_steps():
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))             # <<<<<<<<<<<<<<
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __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_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_WORKER_PORT = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":146
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:             # <<<<<<<<<<<<<<
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 *         s.connect((WORKER_HOST, WORKER_PORT))
 */
  /*with:*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AF_INET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SOCK_STREAM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __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_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = __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:*/ {
          __pyx_v_s = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":147
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)             # <<<<<<<<<<<<<<
 *         s.connect((WORKER_HOST, WORKER_PORT))
 *         data = (b'delete-steps'
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_setsockopt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_IPPROTO_TCP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TCP_NODELAY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_4, __pyx_t_1, __pyx_int_1};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
            __Pyx_XDECREF(__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;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":148
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 *         s.connect((WORKER_HOST, WORKER_PORT))             # <<<<<<<<<<<<<<
 *         data = (b'delete-steps'
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_connect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_WORKER_HOST);
          __Pyx_GIVEREF(__pyx_v_WORKER_HOST);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_WORKER_HOST)) __PYX_ERR(0, 148, __pyx_L7_error);
          __Pyx_INCREF(__pyx_v_WORKER_PORT);
          __Pyx_GIVEREF(__pyx_v_WORKER_PORT);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_WORKER_PORT)) __PYX_ERR(0, 148, __pyx_L7_error);
          __pyx_t_4 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":150
 *         s.connect((WORKER_HOST, WORKER_PORT))
 *         data = (b'delete-steps'
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN             # <<<<<<<<<<<<<<
 *                 + b'nothing')
 *         send(s, data)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_hub); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_PIPELINE_SPLIT_TOKEN); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyNumber_Add(__pyx_kp_b_delete_steps, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":151
 *         data = (b'delete-steps'
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN
 *                 + b'nothing')             # <<<<<<<<<<<<<<
 *         send(s, data)
 * 
 */
          __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_n_b_nothing); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_data = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":152
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN
 *                 + b'nothing')
 *         send(s, data)             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_send); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_s, __pyx_v_data};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":146
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:             # <<<<<<<<<<<<<<
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 *         s.connect((WORKER_HOST, WORKER_PORT))
 */
        }
        __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_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("buelon.cython.c_hub.delete_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 146, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_1);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 146, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_12 < 0) __PYX_ERR(0, 146, __pyx_L9_except_error)
          __pyx_t_13 = (!__pyx_t_12);
          if (unlikely(__pyx_t_13)) {
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_2, __pyx_t_1);
            __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; 
            __PYX_ERR(0, 146, __pyx_L9_except_error)
          }
          __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;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__5, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 146, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "buelon/cython/c_hub.pyx":143
 * 
 * 
 * def delete_steps():             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */

  /* 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("buelon.cython.c_hub.delete_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_WORKER_HOST);
  __Pyx_XDECREF(__pyx_v_WORKER_PORT);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":155
 * 
 * 
 * def _delete_steps(self: HubServer):             # <<<<<<<<<<<<<<
 *     self.execute_db_query('delete from steps;')
 *     # with sqlite3.connect(db_path) as conn:
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_12_delete_steps(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;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_delete_steps", 1);

  /* "buelon/cython/c_hub.pyx":156
 * 
 * def _delete_steps(self: HubServer):
 *     self.execute_db_query('delete from steps;')             # <<<<<<<<<<<<<<
 *     # with sqlite3.connect(db_path) as conn:
 *     #     cur = conn.cursor()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s_delete_from_steps};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __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;

  /* "buelon/cython/c_hub.pyx":155
 * 
 * 
 * def _delete_steps(self: HubServer):             # <<<<<<<<<<<<<<
 *     self.execute_db_query('delete from steps;')
 *     # with sqlite3.connect(db_path) as 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_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("buelon.cython.c_hub._delete_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":163
 * 
 * 
 * def reset_errors(include_workers=False):             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_15reset_errors(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_15reset_errors = {"reset_errors", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_15reset_errors, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_15reset_errors(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_include_workers = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset_errors (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_include_workers,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_include_workers);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "reset_errors") < 0)) __PYX_ERR(0, 163, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_include_workers = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reset_errors", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 163, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.reset_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_14reset_errors(__pyx_self, __pyx_v_include_workers);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_14reset_errors(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_include_workers) {
  PyObject *__pyx_v_WORKER_HOST = NULL;
  PyObject *__pyx_v_WORKER_PORT = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_v_data = 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;
  unsigned int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset_errors", 1);

  /* "buelon/cython/c_hub.pyx":164
 * 
 * def reset_errors(include_workers=False):
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')             # <<<<<<<<<<<<<<
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __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_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_WORKER_HOST = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":165
 * def reset_errors(include_workers=False):
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))             # <<<<<<<<<<<<<<
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __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_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_WORKER_PORT = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":166
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:             # <<<<<<<<<<<<<<
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 *         s.connect((WORKER_HOST, WORKER_PORT))
 */
  /*with:*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AF_INET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SOCK_STREAM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __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_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = __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:*/ {
          __pyx_v_s = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":167
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)             # <<<<<<<<<<<<<<
 *         s.connect((WORKER_HOST, WORKER_PORT))
 *         data = (b'reset-errors'
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_setsockopt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_IPPROTO_TCP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TCP_NODELAY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_4, __pyx_t_1, __pyx_int_1};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
            __Pyx_XDECREF(__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;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":168
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 *         s.connect((WORKER_HOST, WORKER_PORT))             # <<<<<<<<<<<<<<
 *         data = (b'reset-errors'
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_connect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_WORKER_HOST);
          __Pyx_GIVEREF(__pyx_v_WORKER_HOST);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_WORKER_HOST)) __PYX_ERR(0, 168, __pyx_L7_error);
          __Pyx_INCREF(__pyx_v_WORKER_PORT);
          __Pyx_GIVEREF(__pyx_v_WORKER_PORT);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_WORKER_PORT)) __PYX_ERR(0, 168, __pyx_L7_error);
          __pyx_t_4 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":170
 *         s.connect((WORKER_HOST, WORKER_PORT))
 *         data = (b'reset-errors'
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN             # <<<<<<<<<<<<<<
 *                 + (b'true' if include_workers else b'false'))
 *         send(s, data)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_hub); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_PIPELINE_SPLIT_TOKEN); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyNumber_Add(__pyx_kp_b_reset_errors, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":171
 *         data = (b'reset-errors'
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN
 *                 + (b'true' if include_workers else b'false'))             # <<<<<<<<<<<<<<
 *         send(s, data)
 * 
 */
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_include_workers); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 171, __pyx_L7_error)
          if (__pyx_t_11) {
            __Pyx_INCREF(__pyx_n_b_true);
            __pyx_t_5 = __pyx_n_b_true;
          } else {
            __Pyx_INCREF(__pyx_n_b_false);
            __pyx_t_5 = __pyx_n_b_false;
          }
          __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __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_v_data = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "buelon/cython/c_hub.pyx":172
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN
 *                 + (b'true' if include_workers else b'false'))
 *         send(s, data)             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_send); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_s, __pyx_v_data};
            __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "buelon/cython/c_hub.pyx":166
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:             # <<<<<<<<<<<<<<
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 *         s.connect((WORKER_HOST, WORKER_PORT))
 */
        }
        __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_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("buelon.cython.c_hub.reset_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_2) < 0) __PYX_ERR(0, 166, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_2);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 166, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_11 < 0) __PYX_ERR(0, 166, __pyx_L9_except_error)
          __pyx_t_13 = (!__pyx_t_11);
          if (unlikely(__pyx_t_13)) {
            __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, 166, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__5, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 166, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "buelon/cython/c_hub.pyx":163
 * 
 * 
 * def reset_errors(include_workers=False):             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */

  /* 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("buelon.cython.c_hub.reset_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_WORKER_HOST);
  __Pyx_XDECREF(__pyx_v_WORKER_PORT);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":175
 * 
 * 
 * def _reset_errors(self: HubServer, include_workers=b'false'):             # <<<<<<<<<<<<<<
 *     suffix = '' if include_workers != b'true' else f' or status = \'{buelon.core.step.StepStatus.working.value}\''
 *     query = f'''
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_16_reset_errors(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_include_workers) {
  PyObject *__pyx_v_suffix = NULL;
  PyObject *__pyx_v_query = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_reset_errors", 1);

  /* "buelon/cython/c_hub.pyx":176
 * 
 * def _reset_errors(self: HubServer, include_workers=b'false'):
 *     suffix = '' if include_workers != b'true' else f' or status = \'{buelon.core.step.StepStatus.working.value}\''             # <<<<<<<<<<<<<<
 *     query = f'''
 *     update steps
 */
  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_include_workers, __pyx_n_b_true, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 176, __pyx_L1_error)
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_kp_s__3);
    __pyx_t_1 = __pyx_kp_s__3;
  } else {
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_or_status);
    __pyx_t_4 += 14;
    __Pyx_GIVEREF(__pyx_kp_u_or_status);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_or_status);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buelon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_core); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_working); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__8);
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __pyx_v_suffix = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":177
 * def _reset_errors(self: HubServer, include_workers=b'false'):
 *     suffix = '' if include_workers != b'true' else f' or status = \'{buelon.core.step.StepStatus.working.value}\''
 *     query = f'''             # <<<<<<<<<<<<<<
 *     update steps
 *     set status = \'{buelon.core.step.StepStatus.pending.value}\'
 */
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = 0;
  __pyx_t_5 = 127;
  __Pyx_INCREF(__pyx_kp_u_update_steps_set_status);
  __pyx_t_4 += 37;
  __Pyx_GIVEREF(__pyx_kp_u_update_steps_set_status);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_update_steps_set_status);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buelon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pending); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_INCREF(__pyx_kp_u_where_status);
  __pyx_t_4 += 23;
  __Pyx_GIVEREF(__pyx_kp_u_where_status);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_where_status);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buelon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_INCREF(__pyx_kp_u__9);
  __pyx_t_4 += 6;
  __Pyx_GIVEREF(__pyx_kp_u__9);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__9);
  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_suffix, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_INCREF(__pyx_kp_u__10);
  __pyx_t_4 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__10);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__10);
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_query = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":182
 *     where status = \'{buelon.core.step.StepStatus.error.value}\'
 *     {suffix};'''
 *     self.execute_db_query(query)             # <<<<<<<<<<<<<<
 *     # with sqlite3.connect(db_path) as conn:
 *     #     cur = conn.cursor()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_query};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":175
 * 
 * 
 * def _reset_errors(self: HubServer, include_workers=b'false'):             # <<<<<<<<<<<<<<
 *     suffix = '' if include_workers != b'true' else f' or status = \'{buelon.core.step.StepStatus.working.value}\''
 *     query = f'''
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("buelon.cython.c_hub._reset_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_suffix);
  __Pyx_XDECREF(__pyx_v_query);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":189
 * 
 * 
 * def get_step_count(types: str | None = None) -> list[dict]:             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_19get_step_count(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_19get_step_count = {"get_step_count", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_19get_step_count, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_19get_step_count(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_types = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_step_count (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_types,0};
    values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_types);
          if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_step_count") < 0)) __PYX_ERR(0, 189, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_types = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_step_count", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 189, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.get_step_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_18get_step_count(__pyx_self, __pyx_v_types);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_18get_step_count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_types) {
  PyObject *__pyx_v_WORKER_HOST = NULL;
  PyObject *__pyx_v_WORKER_PORT = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_v_data = 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;
  unsigned 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;
  int __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_step_count", 1);

  /* "buelon/cython/c_hub.pyx":190
 * 
 * def get_step_count(types: str | None = None) -> list[dict]:
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')             # <<<<<<<<<<<<<<
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __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_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_WORKER_HOST = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":191
 * def get_step_count(types: str | None = None) -> list[dict]:
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))             # <<<<<<<<<<<<<<
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __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_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_WORKER_PORT = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":192
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:             # <<<<<<<<<<<<<<
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 *         s.connect((WORKER_HOST, WORKER_PORT))
 */
  /*with:*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AF_INET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SOCK_STREAM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __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_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 192, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = __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:*/ {
          __pyx_v_s = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":193
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)             # <<<<<<<<<<<<<<
 *         s.connect((WORKER_HOST, WORKER_PORT))
 *         data = (b'step-count'
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_setsockopt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_IPPROTO_TCP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TCP_NODELAY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_4, __pyx_t_1, __pyx_int_1};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
            __Pyx_XDECREF(__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;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":194
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 *         s.connect((WORKER_HOST, WORKER_PORT))             # <<<<<<<<<<<<<<
 *         data = (b'step-count'
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_connect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_WORKER_HOST);
          __Pyx_GIVEREF(__pyx_v_WORKER_HOST);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_WORKER_HOST)) __PYX_ERR(0, 194, __pyx_L7_error);
          __Pyx_INCREF(__pyx_v_WORKER_PORT);
          __Pyx_GIVEREF(__pyx_v_WORKER_PORT);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_WORKER_PORT)) __PYX_ERR(0, 194, __pyx_L7_error);
          __pyx_t_4 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":196
 *         s.connect((WORKER_HOST, WORKER_PORT))
 *         data = (b'step-count'
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN             # <<<<<<<<<<<<<<
 *                 + buelon.helpers.json_parser.dumps({'types': types}))
 *         send(s, data)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_hub); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_PIPELINE_SPLIT_TOKEN); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyNumber_Add(__pyx_kp_b_step_count, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":197
 *         data = (b'step-count'
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN
 *                 + buelon.helpers.json_parser.dumps({'types': types}))             # <<<<<<<<<<<<<<
 *         send(s, data)
 *         return buelon.helpers.json_parser.loads(receive(s))
 */
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_buelon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_helpers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L7_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_dumps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_types, __pyx_v_types) < 0) __PYX_ERR(0, 197, __pyx_L7_error)
          __pyx_t_3 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_1};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          }
          __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_v_data = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "buelon/cython/c_hub.pyx":198
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN
 *                 + buelon.helpers.json_parser.dumps({'types': types}))
 *         send(s, data)             # <<<<<<<<<<<<<<
 *         return buelon.helpers.json_parser.loads(receive(s))
 * 
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_send); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_s, __pyx_v_data};
            __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "buelon/cython/c_hub.pyx":199
 *                 + buelon.helpers.json_parser.dumps({'types': types}))
 *         send(s, data)
 *         return buelon.helpers.json_parser.loads(receive(s))             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __Pyx_XDECREF(__pyx_r);
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_receive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_s};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __pyx_t_1 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
            __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_4))) __PYX_ERR(0, 199, __pyx_L7_error)
          __pyx_r = ((PyObject*)__pyx_t_4);
          __pyx_t_4 = 0;
          goto __pyx_L11_try_return;

          /* "buelon/cython/c_hub.pyx":192
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:             # <<<<<<<<<<<<<<
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 *         s.connect((WORKER_HOST, WORKER_PORT))
 */
        }
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("buelon.cython.c_hub.get_step_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(0, 192, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_1 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 192, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_12 < 0) __PYX_ERR(0, 192, __pyx_L9_except_error)
          __pyx_t_13 = (!__pyx_t_12);
          if (unlikely(__pyx_t_13)) {
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_5);
            __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_2, __pyx_t_5);
            __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_5 = 0; 
            __PYX_ERR(0, 192, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L11_try_return:;
        __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_L4_return;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__5, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L4_return: {
        __pyx_t_14 = __pyx_r;
        __pyx_r = 0;
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__5, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __pyx_r = __pyx_t_14;
        __pyx_t_14 = 0;
        goto __pyx_L0;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "buelon/cython/c_hub.pyx":189
 * 
 * 
 * def get_step_count(types: str | None = None) -> list[dict]:             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */

  /* function exit code */
  __pyx_r = ((PyObject*)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("buelon.cython.c_hub.get_step_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_WORKER_HOST);
  __Pyx_XDECREF(__pyx_v_WORKER_PORT);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":202
 * 
 * 
 * def _get_step_count(self: HubServer, types: str | None = None) -> list[dict]:             # <<<<<<<<<<<<<<
 *     if types == '*':
 *         where = ''
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_20_get_step_count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_types) {
  PyObject *__pyx_v_where = NULL;
  PyObject *__pyx_v_query = NULL;
  PyObject *__pyx_v_table = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __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;
  unsigned int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_step_count", 1);

  /* "buelon/cython/c_hub.pyx":203
 * 
 * def _get_step_count(self: HubServer, types: str | None = None) -> list[dict]:
 *     if types == '*':             # <<<<<<<<<<<<<<
 *         where = ''
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_types, __pyx_kp_s__11, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 203, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":204
 * def _get_step_count(self: HubServer, types: str | None = None) -> list[dict]:
 *     if types == '*':
 *         where = ''             # <<<<<<<<<<<<<<
 *     else:
 *         where = f'''
 */
    __Pyx_INCREF(__pyx_kp_s__3);
    __pyx_v_where = __pyx_kp_s__3;

    /* "buelon/cython/c_hub.pyx":203
 * 
 * def _get_step_count(self: HubServer, types: str | None = None) -> list[dict]:
 *     if types == '*':             # <<<<<<<<<<<<<<
 *         where = ''
 *     else:
 */
    goto __pyx_L3;
  }

  /* "buelon/cython/c_hub.pyx":206
 *         where = ''
 *     else:
 *         where = f'''             # <<<<<<<<<<<<<<
 *         where
 *             status not in (
 */
  /*else*/ {
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __Pyx_INCREF(__pyx_kp_u_where_status_not_in);
    __pyx_t_3 += 61;
    __Pyx_GIVEREF(__pyx_kp_u_where_status_not_in);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_where_status_not_in);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_success); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__12);
    __pyx_t_3 += 21;
    __Pyx_GIVEREF(__pyx_kp_u__12);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__12);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_cancel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__13);
    __pyx_t_3 += 24;
    __Pyx_GIVEREF(__pyx_kp_u__13);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__13);
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_where = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "buelon/cython/c_hub.pyx":214
 *         '''
 * 
 *     query = f'''             # <<<<<<<<<<<<<<
 *     select
 *         status,
 */
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = 0;
  __pyx_t_4 = 127;
  __Pyx_INCREF(__pyx_kp_u_select_status_count_as_amount_f);
  __pyx_t_3 += 84;
  __Pyx_GIVEREF(__pyx_kp_u_select_status_count_as_amount_f);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_select_status_count_as_amount_f);
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_where, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_group_by_status);
  __pyx_t_3 += 35;
  __Pyx_GIVEREF(__pyx_kp_u_group_by_status);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_group_by_status);
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_query = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":224
 *         status;
 *     '''
 *     table = self.execute_db_query(query, json_table=True)             # <<<<<<<<<<<<<<
 *     for row in table:
 *         row['status'] = buelon.core.step.StepStatus(int(row['status'])).name
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_query);
  __Pyx_GIVEREF(__pyx_v_query);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_query)) __PYX_ERR(0, 224, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_json_table, Py_True) < 0) __PYX_ERR(0, 224, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_table = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":225
 *     '''
 *     table = self.execute_db_query(query, json_table=True)
 *     for row in table:             # <<<<<<<<<<<<<<
 *         row['status'] = buelon.core.step.StepStatus(int(row['status'])).name
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_table)) || PyTuple_CheckExact(__pyx_v_table)) {
    __pyx_t_7 = __pyx_v_table; __Pyx_INCREF(__pyx_t_7);
    __pyx_t_3 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_table); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 225, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_7))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 225, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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, 225, __pyx_L1_error)
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 225, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 225, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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, 225, __pyx_L1_error)
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 225, __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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 225, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "buelon/cython/c_hub.pyx":226
 *     table = self.execute_db_query(query, json_table=True)
 *     for row in table:
 *         row['status'] = buelon.core.step.StepStatus(int(row['status'])).name             # <<<<<<<<<<<<<<
 * 
 *     # with sqlite3.connect(db_path) as conn:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_status); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_9};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely((PyObject_SetItem(__pyx_v_row, __pyx_n_s_status, __pyx_t_2) < 0))) __PYX_ERR(0, 226, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "buelon/cython/c_hub.pyx":225
 *     '''
 *     table = self.execute_db_query(query, json_table=True)
 *     for row in table:             # <<<<<<<<<<<<<<
 *         row['status'] = buelon.core.step.StepStatus(int(row['status'])).name
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":238
 *     #         row['status'] = buelon.core.step.StepStatus(int(row['status'])).name
 * 
 *     return table             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(PyList_CheckExact(__pyx_v_table))||((__pyx_v_table) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_v_table))) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_table);
  __pyx_r = ((PyObject*)__pyx_v_table);
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":202
 * 
 * 
 * def _get_step_count(self: HubServer, types: str | None = None) -> list[dict]:             # <<<<<<<<<<<<<<
 *     if types == '*':
 *         where = ''
 */

  /* 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_9);
  __Pyx_AddTraceback("buelon.cython.c_hub._get_step_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_where);
  __Pyx_XDECREF(__pyx_v_query);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":241
 * 
 * 
 * def upload_step(_step: buelon.core.step.Step, status: buelon.core.step.StepStatus) -> None:             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_22upload_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v__step, PyObject *__pyx_v_status) {
  PyObject *__pyx_v_WORKER_HOST = NULL;
  PyObject *__pyx_v_WORKER_PORT = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_v_data = 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;
  unsigned 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;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("upload_step", 1);

  /* "buelon/cython/c_hub.pyx":242
 * 
 * def upload_step(_step: buelon.core.step.Step, status: buelon.core.step.StepStatus) -> None:
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')             # <<<<<<<<<<<<<<
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __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_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_WORKER_HOST = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":243
 * def upload_step(_step: buelon.core.step.Step, status: buelon.core.step.StepStatus) -> None:
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))             # <<<<<<<<<<<<<<
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __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_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_WORKER_PORT = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":244
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:             # <<<<<<<<<<<<<<
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 *         s.connect((WORKER_HOST, WORKER_PORT))
 */
  /*with:*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AF_INET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SOCK_STREAM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __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_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = __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:*/ {
          __pyx_v_s = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":245
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)             # <<<<<<<<<<<<<<
 *         s.connect((WORKER_HOST, WORKER_PORT))
 *         data = (b'upload-step'
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_setsockopt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_IPPROTO_TCP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TCP_NODELAY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_4, __pyx_t_1, __pyx_int_1};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
            __Pyx_XDECREF(__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;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 245, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":246
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 *         s.connect((WORKER_HOST, WORKER_PORT))             # <<<<<<<<<<<<<<
 *         data = (b'upload-step'
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_connect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_WORKER_HOST);
          __Pyx_GIVEREF(__pyx_v_WORKER_HOST);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_WORKER_HOST)) __PYX_ERR(0, 246, __pyx_L7_error);
          __Pyx_INCREF(__pyx_v_WORKER_PORT);
          __Pyx_GIVEREF(__pyx_v_WORKER_PORT);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_WORKER_PORT)) __PYX_ERR(0, 246, __pyx_L7_error);
          __pyx_t_4 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 246, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":248
 *         s.connect((WORKER_HOST, WORKER_PORT))
 *         data = (b'upload-step'
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN             # <<<<<<<<<<<<<<
 *                 + buelon.helpers.json_parser.dumps([_step.to_json(), status.value]))
 *         send(s, data)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_hub); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_PIPELINE_SPLIT_TOKEN); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = PyNumber_Add(__pyx_kp_b_upload_step, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "buelon/cython/c_hub.pyx":249
 *         data = (b'upload-step'
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN
 *                 + buelon.helpers.json_parser.dumps([_step.to_json(), status.value]))             # <<<<<<<<<<<<<<
 *         send(s, data)
 * 
 */
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_buelon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_helpers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L7_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_dumps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_to_json); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_11 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
            __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_status, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_11 = PyList_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 249, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_1);
          if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_1)) __PYX_ERR(0, 249, __pyx_L7_error);
          __Pyx_GIVEREF(__pyx_t_3);
          if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_3)) __PYX_ERR(0, 249, __pyx_L7_error);
          __pyx_t_1 = 0;
          __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_11};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          }
          __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_v_data = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "buelon/cython/c_hub.pyx":250
 *                 + buelon.hub.PIPELINE_SPLIT_TOKEN
 *                 + buelon.helpers.json_parser.dumps([_step.to_json(), status.value]))
 *         send(s, data)             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_send); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_s, __pyx_v_data};
            __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "buelon/cython/c_hub.pyx":244
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:             # <<<<<<<<<<<<<<
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 *         s.connect((WORKER_HOST, WORKER_PORT))
 */
        }
        __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_L12_try_end;
        __pyx_L7_error:;
        __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_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("buelon.cython.c_hub.upload_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_2) < 0) __PYX_ERR(0, 244, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_2);
          __pyx_t_11 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 244, __pyx_L9_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, 244, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_13 < 0) __PYX_ERR(0, 244, __pyx_L9_except_error)
          __pyx_t_14 = (!__pyx_t_13);
          if (unlikely(__pyx_t_14)) {
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_XGIVEREF(__pyx_t_2);
            __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_5, __pyx_t_2);
            __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_2 = 0; 
            __PYX_ERR(0, 244, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__5, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 244, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "buelon/cython/c_hub.pyx":241
 * 
 * 
 * def upload_step(_step: buelon.core.step.Step, status: buelon.core.step.StepStatus) -> None:             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */

  /* 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_11);
  __Pyx_AddTraceback("buelon.cython.c_hub.upload_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_WORKER_HOST);
  __Pyx_XDECREF(__pyx_v_WORKER_PORT);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":253
 * 
 * 
 * def _upload_step(self: HubServer, step_json: dict, status_value: int) -> None:             # <<<<<<<<<<<<<<
 *     status = buelon.core.step.StepStatus(status_value)
 *     _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_25_upload_step(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_25_upload_step = {"_upload_step", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_25_upload_step, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_25_upload_step(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_step_json = 0;
  PyObject *__pyx_v_status_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_upload_step (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_step_json,&__pyx_n_s_status_value,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_json)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_upload_step", 1, 3, 3, 1); __PYX_ERR(0, 253, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_status_value)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_upload_step", 1, 3, 3, 2); __PYX_ERR(0, 253, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_upload_step") < 0)) __PYX_ERR(0, 253, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_step_json = ((PyObject*)values[1]);
    __pyx_v_status_value = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_upload_step", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 253, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub._upload_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_json), (&PyDict_Type), 0, "step_json", 1))) __PYX_ERR(0, 253, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_status_value), (&PyInt_Type), 0, "status_value", 1))) __PYX_ERR(0, 253, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_24_upload_step(__pyx_self, __pyx_v_self, __pyx_v_step_json, __pyx_v_status_value);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_24_upload_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_json, PyObject *__pyx_v_status_value) {
  PyObject *__pyx_v_status = NULL;
  PyObject *__pyx_v__step = NULL;
  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;
  unsigned 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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_upload_step", 1);

  /* "buelon/cython/c_hub.pyx":254
 * 
 * def _upload_step(self: HubServer, step_json: dict, status_value: int) -> None:
 *     status = buelon.core.step.StepStatus(status_value)             # <<<<<<<<<<<<<<
 *     _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 *     sql = ('INSERT INTO steps (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace) '
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __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_StepStatus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_status_value};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_status = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":255
 * def _upload_step(self: HubServer, step_json: dict, status_value: int) -> None:
 *     status = buelon.core.step.StepStatus(status_value)
 *     _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)             # <<<<<<<<<<<<<<
 *     sql = ('INSERT INTO steps (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace) '
 *            'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __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_from_json); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_step_json};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_v__step = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":256
 *     status = buelon.core.step.StepStatus(status_value)
 *     _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 *     sql = ('INSERT INTO steps (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace) '             # <<<<<<<<<<<<<<
 *            'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);')
 *     params = (_step.id, _step.priority, _step.scope, _step.timeout, _step.retries, _step.velocity, _step.tag, f'{status.value}', time.time(), '', '')
 */
  __Pyx_INCREF(__pyx_kp_s_INSERT_INTO_steps_id_priority_sc);
  __pyx_v_sql = __pyx_kp_s_INSERT_INTO_steps_id_priority_sc;

  /* "buelon/cython/c_hub.pyx":258
 *     sql = ('INSERT INTO steps (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace) '
 *            'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);')
 *     params = (_step.id, _step.priority, _step.scope, _step.timeout, _step.retries, _step.velocity, _step.tag, f'{status.value}', time.time(), '', '')             # <<<<<<<<<<<<<<
 * 
 *     self.execute_db_query(sql, params)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_priority); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_scope); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_retries); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_velocity); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_tag); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_status, __pyx_n_s_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
    __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __pyx_t_12 = PyTuple_New(11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_8)) __PYX_ERR(0, 258, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_10)) __PYX_ERR(0, 258, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_9)) __PYX_ERR(0, 258, __pyx_L1_error);
  __Pyx_INCREF(__pyx_kp_s__3);
  __Pyx_GIVEREF(__pyx_kp_s__3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 9, __pyx_kp_s__3)) __PYX_ERR(0, 258, __pyx_L1_error);
  __Pyx_INCREF(__pyx_kp_s__3);
  __Pyx_GIVEREF(__pyx_kp_s__3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 10, __pyx_kp_s__3)) __PYX_ERR(0, 258, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_10 = 0;
  __pyx_t_9 = 0;
  __pyx_v_params = ((PyObject*)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "buelon/cython/c_hub.pyx":260
 *     params = (_step.id, _step.priority, _step.scope, _step.timeout, _step.retries, _step.velocity, _step.tag, f'{status.value}', time.time(), '', '')
 * 
 *     self.execute_db_query(sql, params)             # <<<<<<<<<<<<<<
 * 
 *     # with sqlite3.connect(db_path) as conn:
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_v_sql, __pyx_v_params};
    __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "buelon/cython/c_hub.pyx":253
 * 
 * 
 * def _upload_step(self: HubServer, step_json: dict, status_value: int) -> None:             # <<<<<<<<<<<<<<
 *     status = buelon.core.step.StepStatus(status_value)
 *     _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("buelon.cython.c_hub._upload_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XDECREF(__pyx_v__step);
  __Pyx_XDECREF(__pyx_v_sql);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":268
 * 
 * 
 * def _upload_steps(self: HubServer, step_jsons: list, status_values: list) -> None:             # <<<<<<<<<<<<<<
 *     sql = ('INSERT INTO steps (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace) '
 *            'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);')
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_27_upload_steps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_27_upload_steps = {"_upload_steps", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_27_upload_steps, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_27_upload_steps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_step_jsons = 0;
  PyObject *__pyx_v_status_values = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_upload_steps (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_step_jsons,&__pyx_n_s_status_values,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_jsons)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_upload_steps", 1, 3, 3, 1); __PYX_ERR(0, 268, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_status_values)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_upload_steps", 1, 3, 3, 2); __PYX_ERR(0, 268, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_upload_steps") < 0)) __PYX_ERR(0, 268, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_step_jsons = ((PyObject*)values[1]);
    __pyx_v_status_values = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_upload_steps", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 268, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub._upload_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_jsons), (&PyList_Type), 0, "step_jsons", 1))) __PYX_ERR(0, 268, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_status_values), (&PyList_Type), 0, "status_values", 1))) __PYX_ERR(0, 268, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_26_upload_steps(__pyx_self, __pyx_v_self, __pyx_v_step_jsons, __pyx_v_status_values);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_26_upload_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_jsons, PyObject *__pyx_v_status_values) {
  PyObject *__pyx_v_sql = NULL;
  PyObject *__pyx_v_step_json = NULL;
  PyObject *__pyx_v_status_value = NULL;
  PyObject *__pyx_v_status = NULL;
  PyObject *__pyx_v__step = NULL;
  PyObject *__pyx_v_params = 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)(PyObject *);
  unsigned int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_upload_steps", 1);

  /* "buelon/cython/c_hub.pyx":269
 * 
 * def _upload_steps(self: HubServer, step_jsons: list, status_values: list) -> None:
 *     sql = ('INSERT INTO steps (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace) '             # <<<<<<<<<<<<<<
 *            'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);')
 *     for step_json, status_value in zip(step_jsons, status_values):
 */
  __Pyx_INCREF(__pyx_kp_s_INSERT_INTO_steps_id_priority_sc);
  __pyx_v_sql = __pyx_kp_s_INSERT_INTO_steps_id_priority_sc;

  /* "buelon/cython/c_hub.pyx":271
 *     sql = ('INSERT INTO steps (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace) '
 *            'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);')
 *     for step_json, status_value in zip(step_jsons, status_values):             # <<<<<<<<<<<<<<
 *         status = buelon.core.step.StepStatus(status_value)
 *         _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_step_jsons);
  __Pyx_GIVEREF(__pyx_v_step_jsons);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_step_jsons)) __PYX_ERR(0, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_status_values);
  __Pyx_GIVEREF(__pyx_v_status_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_status_values)) __PYX_ERR(0, 271, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __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))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 271, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 271, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 271, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 271, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 271, __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;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 271, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __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, 271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      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, 271, __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, 271, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_step_json, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_status_value, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "buelon/cython/c_hub.pyx":272
 *            'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);')
 *     for step_json, status_value in zip(step_jsons, status_values):
 *         status = buelon.core.step.StepStatus(status_value)             # <<<<<<<<<<<<<<
 *         _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 *         params = (
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buelon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_core); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_status_value};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_status, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "buelon/cython/c_hub.pyx":273
 *     for step_json, status_value in zip(step_jsons, status_values):
 *         status = buelon.core.step.StepStatus(status_value)
 *         _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)             # <<<<<<<<<<<<<<
 *         params = (
 *             _step.id, _step.priority, _step.scope, _step.timeout, _step.retries, _step.velocity, _step.tag, f'{status.value}', time.time(), '', '')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buelon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_core); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Step); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_from_json); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_step_json};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v__step, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "buelon/cython/c_hub.pyx":275
 *         _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 *         params = (
 *             _step.id, _step.priority, _step.scope, _step.timeout, _step.retries, _step.velocity, _step.tag, f'{status.value}', time.time(), '', '')             # <<<<<<<<<<<<<<
 *         self.execute_db_query(sql, params)
 *     # with sqlite3.connect(db_path) as conn:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_priority); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_scope); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_timeout); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_retries); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_velocity); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_tag); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_status, __pyx_n_s_value); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_14 = __Pyx_PyObject_FormatSimple(__pyx_t_13, __pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_time); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_time); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_15 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_16))) {
      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16);
      if (likely(__pyx_t_15)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
        __Pyx_INCREF(__pyx_t_15);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_16, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_15, NULL};
      __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    }
    __pyx_t_16 = PyTuple_New(11); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_7)) __PYX_ERR(0, 275, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_10)) __PYX_ERR(0, 275, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_11);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_12);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_12)) __PYX_ERR(0, 275, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_14);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_14)) __PYX_ERR(0, 275, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_13);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 8, __pyx_t_13)) __PYX_ERR(0, 275, __pyx_L1_error);
    __Pyx_INCREF(__pyx_kp_s__3);
    __Pyx_GIVEREF(__pyx_kp_s__3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 9, __pyx_kp_s__3)) __PYX_ERR(0, 275, __pyx_L1_error);
    __Pyx_INCREF(__pyx_kp_s__3);
    __Pyx_GIVEREF(__pyx_kp_s__3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 10, __pyx_kp_s__3)) __PYX_ERR(0, 275, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_7 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_10 = 0;
    __pyx_t_11 = 0;
    __pyx_t_12 = 0;
    __pyx_t_14 = 0;
    __pyx_t_13 = 0;
    __Pyx_XDECREF_SET(__pyx_v_params, ((PyObject*)__pyx_t_16));
    __pyx_t_16 = 0;

    /* "buelon/cython/c_hub.pyx":276
 *         params = (
 *             _step.id, _step.priority, _step.scope, _step.timeout, _step.retries, _step.velocity, _step.tag, f'{status.value}', time.time(), '', '')
 *         self.execute_db_query(sql, params)             # <<<<<<<<<<<<<<
 *     # with sqlite3.connect(db_path) as conn:
 *     #     cur = conn.cursor()
 */
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_14 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_13, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_v_sql, __pyx_v_params};
      __pyx_t_16 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 276, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

    /* "buelon/cython/c_hub.pyx":271
 *     sql = ('INSERT INTO steps (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace) '
 *            'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);')
 *     for step_json, status_value in zip(step_jsons, status_values):             # <<<<<<<<<<<<<<
 *         status = buelon.core.step.StepStatus(status_value)
 *         _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":268
 * 
 * 
 * def _upload_steps(self: HubServer, step_jsons: list, status_values: list) -> None:             # <<<<<<<<<<<<<<
 *     sql = ('INSERT INTO steps (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace) '
 *            'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);')
 */

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("buelon.cython.c_hub._upload_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sql);
  __Pyx_XDECREF(__pyx_v_step_json);
  __Pyx_XDECREF(__pyx_v_status_value);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XDECREF(__pyx_v__step);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":288
 * 
 * 
 * def upload_pipe_code(             # <<<<<<<<<<<<<<
 *         code: str,
 *         lazy_steps: bool = False,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_29upload_pipe_code(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_29upload_pipe_code = {"upload_pipe_code", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_29upload_pipe_code, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_29upload_pipe_code(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_code = 0;
  CYTHON_UNUSED PyObject *__pyx_v_lazy_steps = 0;
  PyObject *__pyx_v_wait_until_finish = 0;
  PyObject *__pyx_v_return_job_ids = 0;
  PyObject *__pyx_v_return_job_def_id = 0;
  PyObject *__pyx_v_job_handler = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("upload_pipe_code (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_code,&__pyx_n_s_lazy_steps,&__pyx_n_s_wait_until_finish,&__pyx_n_s_return_job_ids,&__pyx_n_s_return_job_def_id,&__pyx_n_s_job_handler,0};

    /* "buelon/cython/c_hub.pyx":290
 * def upload_pipe_code(
 *         code: str,
 *         lazy_steps: bool = False,             # <<<<<<<<<<<<<<
 *         wait_until_finish: bool = False,
 *         return_job_ids: bool = False,
 */
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));

    /* "buelon/cython/c_hub.pyx":291
 *         code: str,
 *         lazy_steps: bool = False,
 *         wait_until_finish: bool = False,             # <<<<<<<<<<<<<<
 *         return_job_ids: bool = False,
 *         return_job_def_id: str | list[str] | None = None,
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));

    /* "buelon/cython/c_hub.pyx":292
 *         lazy_steps: bool = False,
 *         wait_until_finish: bool = False,
 *         return_job_ids: bool = False,             # <<<<<<<<<<<<<<
 *         return_job_def_id: str | list[str] | None = None,
 *         job_handler: callable | None = None
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));

    /* "buelon/cython/c_hub.pyx":293
 *         wait_until_finish: bool = False,
 *         return_job_ids: bool = False,
 *         return_job_def_id: str | list[str] | None = None,             # <<<<<<<<<<<<<<
 *         job_handler: callable | None = None
 * ) -> str | list[str] | tuple[str | list[str] | None, list[str]] | None:
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "buelon/cython/c_hub.pyx":294
 *         return_job_ids: bool = False,
 *         return_job_def_id: str | list[str] | None = None,
 *         job_handler: callable | None = None             # <<<<<<<<<<<<<<
 * ) -> str | list[str] | tuple[str | list[str] | None, list[str]] | None:
 *     client = HubClient()
 */
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_code)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lazy_steps);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_wait_until_finish);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_return_job_ids);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_return_job_def_id);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_job_handler);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "upload_pipe_code") < 0)) __PYX_ERR(0, 288, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_code = ((PyObject*)values[0]);
    __pyx_v_lazy_steps = values[1];
    __pyx_v_wait_until_finish = values[2];
    __pyx_v_return_job_ids = values[3];
    __pyx_v_return_job_def_id = values[4];
    __pyx_v_job_handler = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("upload_pipe_code", 0, 1, 6, __pyx_nargs); __PYX_ERR(0, 288, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.upload_pipe_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code), (&PyString_Type), 0, "code", 1))) __PYX_ERR(0, 289, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_28upload_pipe_code(__pyx_self, __pyx_v_code, __pyx_v_lazy_steps, __pyx_v_wait_until_finish, __pyx_v_return_job_ids, __pyx_v_return_job_def_id, __pyx_v_job_handler);

  /* "buelon/cython/c_hub.pyx":288
 * 
 * 
 * def upload_pipe_code(             # <<<<<<<<<<<<<<
 *         code: str,
 *         lazy_steps: bool = False,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_16upload_pipe_code_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":355
 *             print('waiting' + ('.' * (i % 4)))
 *             i += 1
 *             for row in client.get_rows(','.join(row[0] for row in rows)):             # <<<<<<<<<<<<<<
 *                 # print(row)
 *                 if (row['status'] == buelon.core.step.StepStatus.success.name
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_16upload_pipe_code_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 355, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_16upload_pipe_code_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_upload_pipe_code_locals_genexpr, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 355, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.upload_pipe_code.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_6buelon_6cython_5c_hub_16upload_pipe_code_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 355, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 355, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 355, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 355, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 355, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 355, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 355, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_row);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_row, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_row, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 355, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":288
 * 
 * 
 * def upload_pipe_code(             # <<<<<<<<<<<<<<
 *         code: str,
 *         lazy_steps: bool = False,
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_28upload_pipe_code(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code, CYTHON_UNUSED PyObject *__pyx_v_lazy_steps, PyObject *__pyx_v_wait_until_finish, PyObject *__pyx_v_return_job_ids, PyObject *__pyx_v_return_job_def_id, PyObject *__pyx_v_job_handler) {
  PyObject *__pyx_v_client = NULL;
  long __pyx_v_chunk_size;
  PyObject *__pyx_v_chunk = NULL;
  PyObject *__pyx_v_statuses = NULL;
  PyObject *__pyx_v_pending = NULL;
  PyObject *__pyx_v_queued = NULL;
  PyObject *__pyx_v_job_ids = NULL;
  PyObject *__pyx_v_conn = NULL;
  PyObject *__pyx_v_cur = NULL;
  PyObject *__pyx_v_job = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_key_map = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_7genexpr__pyx_v_s = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_s = NULL;
  PyObject *__pyx_v_rows = NULL;
  PyObject *__pyx_8genexpr2__pyx_v_row = NULL;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_16upload_pipe_code_2generator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  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;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_UCS4 __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("upload_pipe_code", 0);
  __Pyx_INCREF(__pyx_v_return_job_def_id);

  /* "buelon/cython/c_hub.pyx":296
 *         job_handler: callable | None = None
 * ) -> str | list[str] | tuple[str | list[str] | None, list[str]] | None:
 *     client = HubClient()             # <<<<<<<<<<<<<<
 *     chunk_size = 2000  # 5000 if not lazy_steps else 500
 *     chunk = []
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_HubClient); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_client = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":297
 * ) -> str | list[str] | tuple[str | list[str] | None, list[str]] | None:
 *     client = HubClient()
 *     chunk_size = 2000  # 5000 if not lazy_steps else 500             # <<<<<<<<<<<<<<
 *     chunk = []
 *     statuses = []
 */
  __pyx_v_chunk_size = 0x7D0;

  /* "buelon/cython/c_hub.pyx":298
 *     client = HubClient()
 *     chunk_size = 2000  # 5000 if not lazy_steps else 500
 *     chunk = []             # <<<<<<<<<<<<<<
 *     statuses = []
 *     pending = buelon.core.step.StepStatus.pending.value
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_chunk = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":299
 *     chunk_size = 2000  # 5000 if not lazy_steps else 500
 *     chunk = []
 *     statuses = []             # <<<<<<<<<<<<<<
 *     pending = buelon.core.step.StepStatus.pending.value
 *     queued = buelon.core.step.StepStatus.queued.value
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_statuses = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":300
 *     chunk = []
 *     statuses = []
 *     pending = buelon.core.step.StepStatus.pending.value             # <<<<<<<<<<<<<<
 *     queued = buelon.core.step.StepStatus.queued.value
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_buelon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_core); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __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_StepStatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pending); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __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_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_pending = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":301
 *     statuses = []
 *     pending = buelon.core.step.StepStatus.pending.value
 *     queued = buelon.core.step.StepStatus.queued.value             # <<<<<<<<<<<<<<
 * 
 *     job_ids = []
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_queued); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_queued = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":303
 *     queued = buelon.core.step.StepStatus.queued.value
 * 
 *     job_ids = []             # <<<<<<<<<<<<<<
 * 
 *     if wait_until_finish:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_job_ids = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":305
 *     job_ids = []
 * 
 *     if wait_until_finish:             # <<<<<<<<<<<<<<
 *         conn = sqlite3.connect(db_path)
 *         cur = conn.cursor()
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_wait_until_finish); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 305, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "buelon/cython/c_hub.pyx":306
 * 
 *     if wait_until_finish:
 *         conn = sqlite3.connect(db_path)             # <<<<<<<<<<<<<<
 *         cur = conn.cursor()
 *         cur.execute('drop table if exists bue_session_ids;')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sqlite3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_connect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_db_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_v_conn = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":307
 *     if wait_until_finish:
 *         conn = sqlite3.connect(db_path)
 *         cur = conn.cursor()             # <<<<<<<<<<<<<<
 *         cur.execute('drop table if exists bue_session_ids;')
 *         cur.execute('create table bue_session_ids (id text primary key, attempts int);')
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_cursor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_v_cur = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":308
 *         conn = sqlite3.connect(db_path)
 *         cur = conn.cursor()
 *         cur.execute('drop table if exists bue_session_ids;')             # <<<<<<<<<<<<<<
 *         cur.execute('create table bue_session_ids (id text primary key, attempts int);')
 *         conn.commit()
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s_drop_table_if_exists_bue_session};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __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;

    /* "buelon/cython/c_hub.pyx":309
 *         cur = conn.cursor()
 *         cur.execute('drop table if exists bue_session_ids;')
 *         cur.execute('create table bue_session_ids (id text primary key, attempts int);')             # <<<<<<<<<<<<<<
 *         conn.commit()
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s_create_table_bue_session_ids_id};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __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;

    /* "buelon/cython/c_hub.pyx":310
 *         cur.execute('drop table if exists bue_session_ids;')
 *         cur.execute('create table bue_session_ids (id text primary key, attempts int);')
 *         conn.commit()             # <<<<<<<<<<<<<<
 * 
 *     for job in tqdm.tqdm(buelon.core.pipe_interpreter.generate_steps_from_code(code), desc='Uploading Jobs'):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_commit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __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;

    /* "buelon/cython/c_hub.pyx":305
 *     job_ids = []
 * 
 *     if wait_until_finish:             # <<<<<<<<<<<<<<
 *         conn = sqlite3.connect(db_path)
 *         cur = conn.cursor()
 */
  }

  /* "buelon/cython/c_hub.pyx":312
 *         conn.commit()
 * 
 *     for job in tqdm.tqdm(buelon.core.pipe_interpreter.generate_steps_from_code(code), desc='Uploading Jobs'):             # <<<<<<<<<<<<<<
 *         if job_handler:
 *             try:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pipe_interpreter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_generate_steps_from_code); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_code};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_desc, __pyx_kp_s_Uploading_Jobs) < 0) __PYX_ERR(0, 312, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  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_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 312, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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, 312, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 312, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 312, __pyx_L1_error)
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_8(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 312, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_job, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "buelon/cython/c_hub.pyx":313
 * 
 *     for job in tqdm.tqdm(buelon.core.pipe_interpreter.generate_steps_from_code(code), desc='Uploading Jobs'):
 *         if job_handler:             # <<<<<<<<<<<<<<
 *             try:
 *                 job_handler(job)
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_job_handler); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 313, __pyx_L1_error)
    if (__pyx_t_5) {

      /* "buelon/cython/c_hub.pyx":314
 *     for job in tqdm.tqdm(buelon.core.pipe_interpreter.generate_steps_from_code(code), desc='Uploading Jobs'):
 *         if job_handler:
 *             try:             # <<<<<<<<<<<<<<
 *                 job_handler(job)
 *             except: pass
 */
      {
        __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:*/ {

          /* "buelon/cython/c_hub.pyx":315
 *         if job_handler:
 *             try:
 *                 job_handler(job)             # <<<<<<<<<<<<<<
 *             except: pass
 * 
 */
          __Pyx_INCREF(__pyx_v_job_handler);
          __pyx_t_6 = __pyx_v_job_handler; __pyx_t_3 = NULL;
          __pyx_t_4 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
              __pyx_t_4 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_job};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":314
 *     for job in tqdm.tqdm(buelon.core.pipe_interpreter.generate_steps_from_code(code), desc='Uploading Jobs'):
 *         if job_handler:
 *             try:             # <<<<<<<<<<<<<<
 *                 job_handler(job)
 *             except: pass
 */
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "buelon/cython/c_hub.pyx":316
 *             try:
 *                 job_handler(job)
 *             except: pass             # <<<<<<<<<<<<<<
 * 
 *         if return_job_def_id:
 */
        /*except:*/ {
          __Pyx_ErrRestore(0,0,0);
          goto __pyx_L8_exception_handled;
        }
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        __pyx_L14_try_end:;
      }

      /* "buelon/cython/c_hub.pyx":313
 * 
 *     for job in tqdm.tqdm(buelon.core.pipe_interpreter.generate_steps_from_code(code), desc='Uploading Jobs'):
 *         if job_handler:             # <<<<<<<<<<<<<<
 *             try:
 *                 job_handler(job)
 */
    }

    /* "buelon/cython/c_hub.pyx":318
 *             except: pass
 * 
 *         if return_job_def_id:             # <<<<<<<<<<<<<<
 *             if isinstance(return_job_def_id, str):
 *                 if job.name == return_job_def_id:
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_return_job_def_id); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 318, __pyx_L1_error)
    if (__pyx_t_5) {

      /* "buelon/cython/c_hub.pyx":319
 * 
 *         if return_job_def_id:
 *             if isinstance(return_job_def_id, str):             # <<<<<<<<<<<<<<
 *                 if job.name == return_job_def_id:
 *                     return_job_def_id = job.id
 */
      __pyx_t_5 = PyString_Check(__pyx_v_return_job_def_id); 
      if (__pyx_t_5) {

        /* "buelon/cython/c_hub.pyx":320
 *         if return_job_def_id:
 *             if isinstance(return_job_def_id, str):
 *                 if job.name == return_job_def_id:             # <<<<<<<<<<<<<<
 *                     return_job_def_id = job.id
 *             elif isinstance(return_job_def_id, list):
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_job, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_return_job_def_id, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 320, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 320, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_5) {

          /* "buelon/cython/c_hub.pyx":321
 *             if isinstance(return_job_def_id, str):
 *                 if job.name == return_job_def_id:
 *                     return_job_def_id = job.id             # <<<<<<<<<<<<<<
 *             elif isinstance(return_job_def_id, list):
 *                 if job.name in return_job_def_id:
 */
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_job, __pyx_n_s_id); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF_SET(__pyx_v_return_job_def_id, __pyx_t_6);
          __pyx_t_6 = 0;

          /* "buelon/cython/c_hub.pyx":320
 *         if return_job_def_id:
 *             if isinstance(return_job_def_id, str):
 *                 if job.name == return_job_def_id:             # <<<<<<<<<<<<<<
 *                     return_job_def_id = job.id
 *             elif isinstance(return_job_def_id, list):
 */
        }

        /* "buelon/cython/c_hub.pyx":319
 * 
 *         if return_job_def_id:
 *             if isinstance(return_job_def_id, str):             # <<<<<<<<<<<<<<
 *                 if job.name == return_job_def_id:
 *                     return_job_def_id = job.id
 */
        goto __pyx_L16;
      }

      /* "buelon/cython/c_hub.pyx":322
 *                 if job.name == return_job_def_id:
 *                     return_job_def_id = job.id
 *             elif isinstance(return_job_def_id, list):             # <<<<<<<<<<<<<<
 *                 if job.name in return_job_def_id:
 *                     return_job_def_id[return_job_def_id.index(job.name)] = job.id
 */
      __pyx_t_5 = PyList_Check(__pyx_v_return_job_def_id); 
      if (__pyx_t_5) {

        /* "buelon/cython/c_hub.pyx":323
 *                     return_job_def_id = job.id
 *             elif isinstance(return_job_def_id, list):
 *                 if job.name in return_job_def_id:             # <<<<<<<<<<<<<<
 *                     return_job_def_id[return_job_def_id.index(job.name)] = job.id
 * 
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_job, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_6, __pyx_v_return_job_def_id, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 323, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_5) {

          /* "buelon/cython/c_hub.pyx":324
 *             elif isinstance(return_job_def_id, list):
 *                 if job.name in return_job_def_id:
 *                     return_job_def_id[return_job_def_id.index(job.name)] = job.id             # <<<<<<<<<<<<<<
 * 
 *         if return_job_ids:
 */
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_job, __pyx_n_s_id); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_return_job_def_id, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_job, __pyx_n_s_name); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 324, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = NULL;
          __pyx_t_4 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
              __pyx_t_4 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_12};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
          if (unlikely((PyObject_SetItem(__pyx_v_return_job_def_id, __pyx_t_2, __pyx_t_6) < 0))) __PYX_ERR(0, 324, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "buelon/cython/c_hub.pyx":323
 *                     return_job_def_id = job.id
 *             elif isinstance(return_job_def_id, list):
 *                 if job.name in return_job_def_id:             # <<<<<<<<<<<<<<
 *                     return_job_def_id[return_job_def_id.index(job.name)] = job.id
 * 
 */
        }

        /* "buelon/cython/c_hub.pyx":322
 *                 if job.name == return_job_def_id:
 *                     return_job_def_id = job.id
 *             elif isinstance(return_job_def_id, list):             # <<<<<<<<<<<<<<
 *                 if job.name in return_job_def_id:
 *                     return_job_def_id[return_job_def_id.index(job.name)] = job.id
 */
      }
      __pyx_L16:;

      /* "buelon/cython/c_hub.pyx":318
 *             except: pass
 * 
 *         if return_job_def_id:             # <<<<<<<<<<<<<<
 *             if isinstance(return_job_def_id, str):
 *                 if job.name == return_job_def_id:
 */
    }

    /* "buelon/cython/c_hub.pyx":326
 *                     return_job_def_id[return_job_def_id.index(job.name)] = job.id
 * 
 *         if return_job_ids:             # <<<<<<<<<<<<<<
 *             job_ids.append(job.id)
 *         # print('job', job)
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_return_job_ids); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 326, __pyx_L1_error)
    if (__pyx_t_5) {

      /* "buelon/cython/c_hub.pyx":327
 * 
 *         if return_job_ids:
 *             job_ids.append(job.id)             # <<<<<<<<<<<<<<
 *         # print('job', job)
 *         # continue
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_job, __pyx_n_s_id); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_job_ids, __pyx_t_6); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 327, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "buelon/cython/c_hub.pyx":326
 *                     return_job_def_id[return_job_def_id.index(job.name)] = job.id
 * 
 *         if return_job_ids:             # <<<<<<<<<<<<<<
 *             job_ids.append(job.id)
 *         # print('job', job)
 */
    }

    /* "buelon/cython/c_hub.pyx":330
 *         # print('job', job)
 *         # continue
 *         chunk.append(job)             # <<<<<<<<<<<<<<
 *         statuses.append(pending if not job.parents else queued)
 *         if wait_until_finish:
 */
    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_chunk, __pyx_v_job); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 330, __pyx_L1_error)

    /* "buelon/cython/c_hub.pyx":331
 *         # continue
 *         chunk.append(job)
 *         statuses.append(pending if not job.parents else queued)             # <<<<<<<<<<<<<<
 *         if wait_until_finish:
 *             cur.execute(f'insert into bue_session_ids (id, attempts) values (\'{job.id}\', 0);')
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_job, __pyx_n_s_parents); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 331, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_15 = (!__pyx_t_5);
    if (__pyx_t_15) {
      __Pyx_INCREF(__pyx_v_pending);
      __pyx_t_6 = __pyx_v_pending;
    } else {
      __Pyx_INCREF(__pyx_v_queued);
      __pyx_t_6 = __pyx_v_queued;
    }
    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_statuses, __pyx_t_6); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 331, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "buelon/cython/c_hub.pyx":332
 *         chunk.append(job)
 *         statuses.append(pending if not job.parents else queued)
 *         if wait_until_finish:             # <<<<<<<<<<<<<<
 *             cur.execute(f'insert into bue_session_ids (id, attempts) values (\'{job.id}\', 0);')
 * 
 */
    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_wait_until_finish); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 332, __pyx_L1_error)
    if (__pyx_t_15) {

      /* "buelon/cython/c_hub.pyx":333
 *         statuses.append(pending if not job.parents else queued)
 *         if wait_until_finish:
 *             cur.execute(f'insert into bue_session_ids (id, attempts) values (\'{job.id}\', 0);')             # <<<<<<<<<<<<<<
 * 
 *         if len(chunk) >= chunk_size:
 */
      if (unlikely(!__pyx_v_cur)) { __Pyx_RaiseUnboundLocalError("cur"); __PYX_ERR(0, 333, __pyx_L1_error) }
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_16 = 0;
      __pyx_t_17 = 127;
      __Pyx_INCREF(__pyx_kp_u_insert_into_bue_session_ids_id_a);
      __pyx_t_16 += 52;
      __Pyx_GIVEREF(__pyx_kp_u_insert_into_bue_session_ids_id_a);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_insert_into_bue_session_ids_id_a);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_job, __pyx_n_s_id); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_t_12, __pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_17 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) > __pyx_t_17) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) : __pyx_t_17;
      __pyx_t_16 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_13);
      __pyx_t_13 = 0;
      __Pyx_INCREF(__pyx_kp_u_0);
      __pyx_t_16 += 6;
      __Pyx_GIVEREF(__pyx_kp_u_0);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_0);
      __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_13};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "buelon/cython/c_hub.pyx":332
 *         chunk.append(job)
 *         statuses.append(pending if not job.parents else queued)
 *         if wait_until_finish:             # <<<<<<<<<<<<<<
 *             cur.execute(f'insert into bue_session_ids (id, attempts) values (\'{job.id}\', 0);')
 * 
 */
    }

    /* "buelon/cython/c_hub.pyx":335
 *             cur.execute(f'insert into bue_session_ids (id, attempts) values (\'{job.id}\', 0);')
 * 
 *         if len(chunk) >= chunk_size:             # <<<<<<<<<<<<<<
 *             set_steps(chunk)
 *             client.upload_steps([s.to_json() for s in chunk], statuses)
 */
    __pyx_t_16 = __Pyx_PyList_GET_SIZE(__pyx_v_chunk); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 335, __pyx_L1_error)
    __pyx_t_15 = (__pyx_t_16 >= __pyx_v_chunk_size);
    if (__pyx_t_15) {

      /* "buelon/cython/c_hub.pyx":336
 * 
 *         if len(chunk) >= chunk_size:
 *             set_steps(chunk)             # <<<<<<<<<<<<<<
 *             client.upload_steps([s.to_json() for s in chunk], statuses)
 *             chunk.clear()
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_set_steps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_13 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_chunk};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "buelon/cython/c_hub.pyx":337
 *         if len(chunk) >= chunk_size:
 *             set_steps(chunk)
 *             client.upload_steps([s.to_json() for s in chunk], statuses)             # <<<<<<<<<<<<<<
 *             chunk.clear()
 *             statuses.clear()
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_client, __pyx_n_s_upload_steps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      { /* enter inner scope */
        __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 337, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_3 = __pyx_v_chunk; __Pyx_INCREF(__pyx_t_3);
        __pyx_t_16 = 0;
        for (;;) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 337, __pyx_L24_error)
            #endif
            if (__pyx_t_16 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_12 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_16); __Pyx_INCREF(__pyx_t_12); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 337, __pyx_L24_error)
          #else
          __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_12);
          #endif
          __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_s, __pyx_t_12);
          __pyx_t_12 = 0;
          __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_s, __pyx_n_s_to_json); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 337, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_19 = NULL;
          __pyx_t_4 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_18))) {
            __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_18);
            if (likely(__pyx_t_19)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
              __Pyx_INCREF(__pyx_t_19);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_18, function);
              __pyx_t_4 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_19, NULL};
            __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L24_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          }
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_13, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 337, __pyx_L24_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_7genexpr__pyx_v_s); __pyx_7genexpr__pyx_v_s = 0;
        goto __pyx_L28_exit_scope;
        __pyx_L24_error:;
        __Pyx_XDECREF(__pyx_7genexpr__pyx_v_s); __pyx_7genexpr__pyx_v_s = 0;
        goto __pyx_L1_error;
        __pyx_L28_exit_scope:;
      } /* exit inner scope */
      __pyx_t_3 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_13, __pyx_v_statuses};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "buelon/cython/c_hub.pyx":338
 *             set_steps(chunk)
 *             client.upload_steps([s.to_json() for s in chunk], statuses)
 *             chunk.clear()             # <<<<<<<<<<<<<<
 *             statuses.clear()
 * 
 */
      __pyx_t_6 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_clear, __pyx_v_chunk); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "buelon/cython/c_hub.pyx":339
 *             client.upload_steps([s.to_json() for s in chunk], statuses)
 *             chunk.clear()
 *             statuses.clear()             # <<<<<<<<<<<<<<
 * 
 *     if chunk:
 */
      __pyx_t_6 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_clear, __pyx_v_statuses); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "buelon/cython/c_hub.pyx":335
 *             cur.execute(f'insert into bue_session_ids (id, attempts) values (\'{job.id}\', 0);')
 * 
 *         if len(chunk) >= chunk_size:             # <<<<<<<<<<<<<<
 *             set_steps(chunk)
 *             client.upload_steps([s.to_json() for s in chunk], statuses)
 */
    }

    /* "buelon/cython/c_hub.pyx":312
 *         conn.commit()
 * 
 *     for job in tqdm.tqdm(buelon.core.pipe_interpreter.generate_steps_from_code(code), desc='Uploading Jobs'):             # <<<<<<<<<<<<<<
 *         if job_handler:
 *             try:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":341
 *             statuses.clear()
 * 
 *     if chunk:             # <<<<<<<<<<<<<<
 *         set_steps(chunk)
 *         client.upload_steps([s.to_json() for s in chunk], statuses)
 */
  __pyx_t_15 = (PyList_GET_SIZE(__pyx_v_chunk) != 0);
  if (__pyx_t_15) {

    /* "buelon/cython/c_hub.pyx":342
 * 
 *     if chunk:
 *         set_steps(chunk)             # <<<<<<<<<<<<<<
 *         client.upload_steps([s.to_json() for s in chunk], statuses)
 *         chunk.clear()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_set_steps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_chunk};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":343
 *     if chunk:
 *         set_steps(chunk)
 *         client.upload_steps([s.to_json() for s in chunk], statuses)             # <<<<<<<<<<<<<<
 *         chunk.clear()
 *         statuses.clear()
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_client, __pyx_n_s_upload_steps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L33_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_13 = __pyx_v_chunk; __Pyx_INCREF(__pyx_t_13);
      __pyx_t_7 = 0;
      for (;;) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 343, __pyx_L33_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 343, __pyx_L33_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L33_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_s, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_s, __pyx_n_s_to_json); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 343, __pyx_L33_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_18 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_18)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_18);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_18, NULL};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L33_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 343, __pyx_L33_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s); __pyx_8genexpr1__pyx_v_s = 0;
      goto __pyx_L37_exit_scope;
      __pyx_L33_error:;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s); __pyx_8genexpr1__pyx_v_s = 0;
      goto __pyx_L1_error;
      __pyx_L37_exit_scope:;
    } /* exit inner scope */
    __pyx_t_13 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_t_2, __pyx_v_statuses};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":344
 *         set_steps(chunk)
 *         client.upload_steps([s.to_json() for s in chunk], statuses)
 *         chunk.clear()             # <<<<<<<<<<<<<<
 *         statuses.clear()
 * 
 */
    __pyx_t_1 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_clear, __pyx_v_chunk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":345
 *         client.upload_steps([s.to_json() for s in chunk], statuses)
 *         chunk.clear()
 *         statuses.clear()             # <<<<<<<<<<<<<<
 * 
 *     if wait_until_finish:
 */
    __pyx_t_1 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_clear, __pyx_v_statuses); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":341
 *             statuses.clear()
 * 
 *     if chunk:             # <<<<<<<<<<<<<<
 *         set_steps(chunk)
 *         client.upload_steps([s.to_json() for s in chunk], statuses)
 */
  }

  /* "buelon/cython/c_hub.pyx":347
 *         statuses.clear()
 * 
 *     if wait_until_finish:             # <<<<<<<<<<<<<<
 *         conn.commit()
 *         time.sleep(10.)
 */
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_wait_until_finish); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 347, __pyx_L1_error)
  if (__pyx_t_15) {

    /* "buelon/cython/c_hub.pyx":348
 * 
 *     if wait_until_finish:
 *         conn.commit()             # <<<<<<<<<<<<<<
 *         time.sleep(10.)
 *         i = 1
 */
    if (unlikely(!__pyx_v_conn)) { __Pyx_RaiseUnboundLocalError("conn"); __PYX_ERR(0, 348, __pyx_L1_error) }
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_commit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":349
 *     if wait_until_finish:
 *         conn.commit()
 *         time.sleep(10.)             # <<<<<<<<<<<<<<
 *         i = 1
 *         while (rows := cur.execute('select id, attempts from bue_session_ids limit 10;').fetchall()):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sleep); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_float_10_};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __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;

    /* "buelon/cython/c_hub.pyx":350
 *         conn.commit()
 *         time.sleep(10.)
 *         i = 1             # <<<<<<<<<<<<<<
 *         while (rows := cur.execute('select id, attempts from bue_session_ids limit 10;').fetchall()):
 *             key_map = {row[0]: row[1] for row in rows}
 */
    __Pyx_INCREF(__pyx_int_1);
    __pyx_v_i = __pyx_int_1;

    /* "buelon/cython/c_hub.pyx":351
 *         time.sleep(10.)
 *         i = 1
 *         while (rows := cur.execute('select id, attempts from bue_session_ids limit 10;').fetchall()):             # <<<<<<<<<<<<<<
 *             key_map = {row[0]: row[1] for row in rows}
 *             print('waiting' + ('.' * (i % 4)))
 */
    while (1) {
      if (unlikely(!__pyx_v_cur)) { __Pyx_RaiseUnboundLocalError("cur"); __PYX_ERR(0, 351, __pyx_L1_error) }
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_13 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_kp_s_select_id_attempts_from_bue_sess};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fetchall); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_XDECREF_SET(__pyx_v_rows, __pyx_t_1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 351, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!__pyx_t_15) break;

      /* "buelon/cython/c_hub.pyx":352
 *         i = 1
 *         while (rows := cur.execute('select id, attempts from bue_session_ids limit 10;').fetchall()):
 *             key_map = {row[0]: row[1] for row in rows}             # <<<<<<<<<<<<<<
 *             print('waiting' + ('.' * (i % 4)))
 *             i += 1
 */
      { /* enter inner scope */
        __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L43_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (likely(PyList_CheckExact(__pyx_v_rows)) || PyTuple_CheckExact(__pyx_v_rows)) {
          __pyx_t_6 = __pyx_v_rows; __Pyx_INCREF(__pyx_t_6);
          __pyx_t_7 = 0;
          __pyx_t_8 = NULL;
        } else {
          __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_rows); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 352, __pyx_L43_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 352, __pyx_L43_error)
        }
        for (;;) {
          if (likely(!__pyx_t_8)) {
            if (likely(PyList_CheckExact(__pyx_t_6))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 352, __pyx_L43_error)
                #endif
                if (__pyx_t_7 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 352, __pyx_L43_error)
              #else
              __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L43_error)
              __Pyx_GOTREF(__pyx_t_2);
              #endif
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 352, __pyx_L43_error)
                #endif
                if (__pyx_t_7 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 352, __pyx_L43_error)
              #else
              __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L43_error)
              __Pyx_GOTREF(__pyx_t_2);
              #endif
            }
          } else {
            __pyx_t_2 = __pyx_t_8(__pyx_t_6);
            if (unlikely(!__pyx_t_2)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 352, __pyx_L43_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_2);
          }
          __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_row, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_GetItemInt(__pyx_8genexpr2__pyx_v_row, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L43_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_8genexpr2__pyx_v_row, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 352, __pyx_L43_error)
          __Pyx_GOTREF(__pyx_t_13);
          if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_2, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 352, __pyx_L43_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_row); __pyx_8genexpr2__pyx_v_row = 0;
        goto __pyx_L47_exit_scope;
        __pyx_L43_error:;
        __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_row); __pyx_8genexpr2__pyx_v_row = 0;
        goto __pyx_L1_error;
        __pyx_L47_exit_scope:;
      } /* exit inner scope */
      __Pyx_XDECREF_SET(__pyx_v_key_map, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "buelon/cython/c_hub.pyx":353
 *         while (rows := cur.execute('select id, attempts from bue_session_ids limit 10;').fetchall()):
 *             key_map = {row[0]: row[1] for row in rows}
 *             print('waiting' + ('.' * (i % 4)))             # <<<<<<<<<<<<<<
 *             i += 1
 *             for row in client.get_rows(','.join(row[0] for row in rows)):
 */
      __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_i, __pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyNumber_Multiply(__pyx_kp_s__14, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_n_s_waiting, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "buelon/cython/c_hub.pyx":354
 *             key_map = {row[0]: row[1] for row in rows}
 *             print('waiting' + ('.' * (i % 4)))
 *             i += 1             # <<<<<<<<<<<<<<
 *             for row in client.get_rows(','.join(row[0] for row in rows)):
 *                 # print(row)
 */
      __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "buelon/cython/c_hub.pyx":355
 *             print('waiting' + ('.' * (i % 4)))
 *             i += 1
 *             for row in client.get_rows(','.join(row[0] for row in rows)):             # <<<<<<<<<<<<<<
 *                 # print(row)
 *                 if (row['status'] == buelon.core.step.StepStatus.success.name
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_client, __pyx_n_s_get_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_13 = __pyx_pf_6buelon_6cython_5c_hub_16upload_pipe_code_genexpr(NULL, __pyx_v_rows); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 355, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__15, __pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_2};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
        __pyx_t_1 = __pyx_t_6; __Pyx_INCREF(__pyx_t_1);
        __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 355, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 355, __pyx_L1_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 355, __pyx_L1_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 355, __pyx_L1_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 355, __pyx_L1_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_8(__pyx_t_1);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 355, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "buelon/cython/c_hub.pyx":357
 *             for row in client.get_rows(','.join(row[0] for row in rows)):
 *                 # print(row)
 *                 if (row['status'] == buelon.core.step.StepStatus.success.name             # <<<<<<<<<<<<<<
 *                         or row['status'] == buelon.core.step.StepStatus.cancel.name):
 *                     cur.execute(f'delete from bue_session_ids where id = \'{row["id"]}\';')
 */
        __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_status); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 357, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 357, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_success); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 357, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 357, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!__pyx_t_5) {
        } else {
          __pyx_t_15 = __pyx_t_5;
          goto __pyx_L51_bool_binop_done;
        }

        /* "buelon/cython/c_hub.pyx":358
 *                 # print(row)
 *                 if (row['status'] == buelon.core.step.StepStatus.success.name
 *                         or row['status'] == buelon.core.step.StepStatus.cancel.name):             # <<<<<<<<<<<<<<
 *                     cur.execute(f'delete from bue_session_ids where id = \'{row["id"]}\';')
 *                     conn.commit()
 */
        __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_buelon); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 358, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_step); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 358, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_cancel); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 358, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 358, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 358, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_15 = __pyx_t_5;
        __pyx_L51_bool_binop_done:;

        /* "buelon/cython/c_hub.pyx":357
 *             for row in client.get_rows(','.join(row[0] for row in rows)):
 *                 # print(row)
 *                 if (row['status'] == buelon.core.step.StepStatus.success.name             # <<<<<<<<<<<<<<
 *                         or row['status'] == buelon.core.step.StepStatus.cancel.name):
 *                     cur.execute(f'delete from bue_session_ids where id = \'{row["id"]}\';')
 */
        if (__pyx_t_15) {

          /* "buelon/cython/c_hub.pyx":359
 *                 if (row['status'] == buelon.core.step.StepStatus.success.name
 *                         or row['status'] == buelon.core.step.StepStatus.cancel.name):
 *                     cur.execute(f'delete from bue_session_ids where id = \'{row["id"]}\';')             # <<<<<<<<<<<<<<
 *                     conn.commit()
 *                 elif row['status'] == buelon.core.step.StepStatus.error.name:
 */
          if (unlikely(!__pyx_v_cur)) { __Pyx_RaiseUnboundLocalError("cur"); __PYX_ERR(0, 359, __pyx_L1_error) }
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_16 = 0;
          __pyx_t_17 = 127;
          __Pyx_INCREF(__pyx_kp_u_delete_from_bue_session_ids_wher);
          __pyx_t_16 += 40;
          __Pyx_GIVEREF(__pyx_kp_u_delete_from_bue_session_ids_wher);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_delete_from_bue_session_ids_wher);
          __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 359, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_17 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_17) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_17;
          __pyx_t_16 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_12);
          __pyx_t_12 = 0;
          __Pyx_INCREF(__pyx_kp_u__16);
          __pyx_t_16 += 2;
          __Pyx_GIVEREF(__pyx_kp_u__16);
          PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__16);
          __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 359, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = NULL;
          __pyx_t_4 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
              __pyx_t_4 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_12};
            __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 359, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "buelon/cython/c_hub.pyx":360
 *                         or row['status'] == buelon.core.step.StepStatus.cancel.name):
 *                     cur.execute(f'delete from bue_session_ids where id = \'{row["id"]}\';')
 *                     conn.commit()             # <<<<<<<<<<<<<<
 *                 elif row['status'] == buelon.core.step.StepStatus.error.name:
 *                     print('Error:', row['msg'])
 */
          if (unlikely(!__pyx_v_conn)) { __Pyx_RaiseUnboundLocalError("conn"); __PYX_ERR(0, 360, __pyx_L1_error) }
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_commit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_12 = NULL;
          __pyx_t_4 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_12)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_12);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
              __pyx_t_4 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
            __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 360, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "buelon/cython/c_hub.pyx":357
 *             for row in client.get_rows(','.join(row[0] for row in rows)):
 *                 # print(row)
 *                 if (row['status'] == buelon.core.step.StepStatus.success.name             # <<<<<<<<<<<<<<
 *                         or row['status'] == buelon.core.step.StepStatus.cancel.name):
 *                     cur.execute(f'delete from bue_session_ids where id = \'{row["id"]}\';')
 */
          goto __pyx_L50;
        }

        /* "buelon/cython/c_hub.pyx":361
 *                     cur.execute(f'delete from bue_session_ids where id = \'{row["id"]}\';')
 *                     conn.commit()
 *                 elif row['status'] == buelon.core.step.StepStatus.error.name:             # <<<<<<<<<<<<<<
 *                     print('Error:', row['msg'])
 *                     # print('Trace:', row['trace'])
 */
        __pyx_t_13 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_status); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 361, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buelon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_core); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 361, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 361, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_name); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 361, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_13, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 361, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__pyx_t_15) {

          /* "buelon/cython/c_hub.pyx":362
 *                     conn.commit()
 *                 elif row['status'] == buelon.core.step.StepStatus.error.name:
 *                     print('Error:', row['msg'])             # <<<<<<<<<<<<<<
 *                     # print('Trace:', row['trace'])
 *                     print('')  # last line deleted
 */
          __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_msg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 362, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_INCREF(__pyx_kp_s_Error);
          __Pyx_GIVEREF(__pyx_kp_s_Error);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_kp_s_Error)) __PYX_ERR(0, 362, __pyx_L1_error);
          __Pyx_GIVEREF(__pyx_t_6);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_6)) __PYX_ERR(0, 362, __pyx_L1_error);
          __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "buelon/cython/c_hub.pyx":364
 *                     print('Error:', row['msg'])
 *                     # print('Trace:', row['trace'])
 *                     print('')  # last line deleted             # <<<<<<<<<<<<<<
 *                     if key_map[row['id']] > 3:
 *                         raise Exception('Max errors met')
 */
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "buelon/cython/c_hub.pyx":365
 *                     # print('Trace:', row['trace'])
 *                     print('')  # last line deleted
 *                     if key_map[row['id']] > 3:             # <<<<<<<<<<<<<<
 *                         raise Exception('Max errors met')
 *                     client.reset_errors(False)
 */
          __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_id); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_key_map, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 365, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyObject_RichCompare(__pyx_t_12, __pyx_int_3, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 365, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(__pyx_t_15)) {

            /* "buelon/cython/c_hub.pyx":366
 *                     print('')  # last line deleted
 *                     if key_map[row['id']] > 3:
 *                         raise Exception('Max errors met')             # <<<<<<<<<<<<<<
 *                     client.reset_errors(False)
 *                     cur.execute(f'update bue_session_ids set attempts = attempts + 1 where id = \'{row["id"]}\';')
 */
            __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_Raise(__pyx_t_6, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __PYX_ERR(0, 366, __pyx_L1_error)

            /* "buelon/cython/c_hub.pyx":365
 *                     # print('Trace:', row['trace'])
 *                     print('')  # last line deleted
 *                     if key_map[row['id']] > 3:             # <<<<<<<<<<<<<<
 *                         raise Exception('Max errors met')
 *                     client.reset_errors(False)
 */
          }

          /* "buelon/cython/c_hub.pyx":367
 *                     if key_map[row['id']] > 3:
 *                         raise Exception('Max errors met')
 *                     client.reset_errors(False)             # <<<<<<<<<<<<<<
 *                     cur.execute(f'update bue_session_ids set attempts = attempts + 1 where id = \'{row["id"]}\';')
 *                     conn.commit()
 */
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_client, __pyx_n_s_reset_errors_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 367, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = NULL;
          __pyx_t_4 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
              __pyx_t_4 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_13, Py_False};
            __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "buelon/cython/c_hub.pyx":368
 *                         raise Exception('Max errors met')
 *                     client.reset_errors(False)
 *                     cur.execute(f'update bue_session_ids set attempts = attempts + 1 where id = \'{row["id"]}\';')             # <<<<<<<<<<<<<<
 *                     conn.commit()
 *             time.sleep(5.)
 */
          if (unlikely(!__pyx_v_cur)) { __Pyx_RaiseUnboundLocalError("cur"); __PYX_ERR(0, 368, __pyx_L1_error) }
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 368, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 368, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_16 = 0;
          __pyx_t_17 = 127;
          __Pyx_INCREF(__pyx_kp_u_update_bue_session_ids_set_attem);
          __pyx_t_16 += 63;
          __Pyx_GIVEREF(__pyx_kp_u_update_bue_session_ids_set_attem);
          PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_kp_u_update_bue_session_ids_set_attem);
          __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_17 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_17) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_17;
          __pyx_t_16 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
          __pyx_t_3 = 0;
          __Pyx_INCREF(__pyx_kp_u__16);
          __pyx_t_16 += 2;
          __Pyx_GIVEREF(__pyx_kp_u__16);
          PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_kp_u__16);
          __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_13, 3, __pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = NULL;
          __pyx_t_4 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
              __pyx_t_4 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_3};
            __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "buelon/cython/c_hub.pyx":369
 *                     client.reset_errors(False)
 *                     cur.execute(f'update bue_session_ids set attempts = attempts + 1 where id = \'{row["id"]}\';')
 *                     conn.commit()             # <<<<<<<<<<<<<<
 *             time.sleep(5.)
 *             delete_last_line()
 */
          if (unlikely(!__pyx_v_conn)) { __Pyx_RaiseUnboundLocalError("conn"); __PYX_ERR(0, 369, __pyx_L1_error) }
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_commit); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 369, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_3 = NULL;
          __pyx_t_4 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
              __pyx_t_4 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
            __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 369, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "buelon/cython/c_hub.pyx":361
 *                     cur.execute(f'delete from bue_session_ids where id = \'{row["id"]}\';')
 *                     conn.commit()
 *                 elif row['status'] == buelon.core.step.StepStatus.error.name:             # <<<<<<<<<<<<<<
 *                     print('Error:', row['msg'])
 *                     # print('Trace:', row['trace'])
 */
        }
        __pyx_L50:;

        /* "buelon/cython/c_hub.pyx":355
 *             print('waiting' + ('.' * (i % 4)))
 *             i += 1
 *             for row in client.get_rows(','.join(row[0] for row in rows)):             # <<<<<<<<<<<<<<
 *                 # print(row)
 *                 if (row['status'] == buelon.core.step.StepStatus.success.name
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "buelon/cython/c_hub.pyx":370
 *                     cur.execute(f'update bue_session_ids set attempts = attempts + 1 where id = \'{row["id"]}\';')
 *                     conn.commit()
 *             time.sleep(5.)             # <<<<<<<<<<<<<<
 *             delete_last_line()
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sleep); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_float_5_};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "buelon/cython/c_hub.pyx":371
 *                     conn.commit()
 *             time.sleep(5.)
 *             delete_last_line()             # <<<<<<<<<<<<<<
 * 
 *         cur.execute('drop table bue_session_ids;')
 */
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_delete_last_line); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_6 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }

    /* "buelon/cython/c_hub.pyx":373
 *             delete_last_line()
 * 
 *         cur.execute('drop table bue_session_ids;')             # <<<<<<<<<<<<<<
 *         conn.commit()
 *         conn.close()
 */
    if (unlikely(!__pyx_v_cur)) { __Pyx_RaiseUnboundLocalError("cur"); __PYX_ERR(0, 373, __pyx_L1_error) }
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_6 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_s_drop_table_bue_session_ids};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":374
 * 
 *         cur.execute('drop table bue_session_ids;')
 *         conn.commit()             # <<<<<<<<<<<<<<
 *         conn.close()
 *         print('Done')
 */
    if (unlikely(!__pyx_v_conn)) { __Pyx_RaiseUnboundLocalError("conn"); __PYX_ERR(0, 374, __pyx_L1_error) }
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_commit); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_6 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":375
 *         cur.execute('drop table bue_session_ids;')
 *         conn.commit()
 *         conn.close()             # <<<<<<<<<<<<<<
 *         print('Done')
 * 
 */
    if (unlikely(!__pyx_v_conn)) { __Pyx_RaiseUnboundLocalError("conn"); __PYX_ERR(0, 375, __pyx_L1_error) }
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_close); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_6 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":376
 *         conn.commit()
 *         conn.close()
 *         print('Done')             # <<<<<<<<<<<<<<
 * 
 *     if return_job_ids:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":347
 *         statuses.clear()
 * 
 *     if wait_until_finish:             # <<<<<<<<<<<<<<
 *         conn.commit()
 *         time.sleep(10.)
 */
  }

  /* "buelon/cython/c_hub.pyx":378
 *         print('Done')
 * 
 *     if return_job_ids:             # <<<<<<<<<<<<<<
 *         if return_job_def_id:
 *             return return_job_def_id, job_ids
 */
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_return_job_ids); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 378, __pyx_L1_error)
  if (__pyx_t_15) {

    /* "buelon/cython/c_hub.pyx":379
 * 
 *     if return_job_ids:
 *         if return_job_def_id:             # <<<<<<<<<<<<<<
 *             return return_job_def_id, job_ids
 *         return job_ids
 */
    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_return_job_def_id); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 379, __pyx_L1_error)
    if (__pyx_t_15) {

      /* "buelon/cython/c_hub.pyx":380
 *     if return_job_ids:
 *         if return_job_def_id:
 *             return return_job_def_id, job_ids             # <<<<<<<<<<<<<<
 *         return job_ids
 *     elif return_job_def_id:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_return_job_def_id);
      __Pyx_GIVEREF(__pyx_v_return_job_def_id);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_return_job_def_id)) __PYX_ERR(0, 380, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_job_ids);
      __Pyx_GIVEREF(__pyx_v_job_ids);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_job_ids)) __PYX_ERR(0, 380, __pyx_L1_error);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "buelon/cython/c_hub.pyx":379
 * 
 *     if return_job_ids:
 *         if return_job_def_id:             # <<<<<<<<<<<<<<
 *             return return_job_def_id, job_ids
 *         return job_ids
 */
    }

    /* "buelon/cython/c_hub.pyx":381
 *         if return_job_def_id:
 *             return return_job_def_id, job_ids
 *         return job_ids             # <<<<<<<<<<<<<<
 *     elif return_job_def_id:
 *         return return_job_def_id
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_job_ids);
    __pyx_r = __pyx_v_job_ids;
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":378
 *         print('Done')
 * 
 *     if return_job_ids:             # <<<<<<<<<<<<<<
 *         if return_job_def_id:
 *             return return_job_def_id, job_ids
 */
  }

  /* "buelon/cython/c_hub.pyx":382
 *             return return_job_def_id, job_ids
 *         return job_ids
 *     elif return_job_def_id:             # <<<<<<<<<<<<<<
 *         return return_job_def_id
 * 
 */
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_return_job_def_id); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 382, __pyx_L1_error)
  if (__pyx_t_15) {

    /* "buelon/cython/c_hub.pyx":383
 *         return job_ids
 *     elif return_job_def_id:
 *         return return_job_def_id             # <<<<<<<<<<<<<<
 * 
 *     return
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_return_job_def_id);
    __pyx_r = __pyx_v_return_job_def_id;
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":382
 *             return return_job_def_id, job_ids
 *         return job_ids
 *     elif return_job_def_id:             # <<<<<<<<<<<<<<
 *         return return_job_def_id
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":385
 *         return return_job_def_id
 * 
 *     return             # <<<<<<<<<<<<<<
 *     variables = buelon.core.pipe_interpreter.get_steps_from_code(code, lazy_steps)
 *     steps = variables['steps']
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":288
 * 
 * 
 * def upload_pipe_code(             # <<<<<<<<<<<<<<
 *         code: str,
 *         lazy_steps: bool = 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_6);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("buelon.cython.c_hub.upload_pipe_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_client);
  __Pyx_XDECREF(__pyx_v_chunk);
  __Pyx_XDECREF(__pyx_v_statuses);
  __Pyx_XDECREF(__pyx_v_pending);
  __Pyx_XDECREF(__pyx_v_queued);
  __Pyx_XDECREF(__pyx_v_job_ids);
  __Pyx_XDECREF(__pyx_v_conn);
  __Pyx_XDECREF(__pyx_v_cur);
  __Pyx_XDECREF(__pyx_v_job);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_key_map);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_s);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_rows);
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_row);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_16upload_pipe_code_2generator);
  __Pyx_XDECREF(__pyx_v_return_job_def_id);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":429
 * 
 * 
 * def upload_pipe_code_from_file(file_path: str, lazy_steps: bool = False, wait_until_finish: bool = False):             # <<<<<<<<<<<<<<
 *     with open(file_path, 'r') as f:
 *         code = f.read()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_31upload_pipe_code_from_file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_31upload_pipe_code_from_file = {"upload_pipe_code_from_file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_31upload_pipe_code_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_31upload_pipe_code_from_file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_file_path = 0;
  PyObject *__pyx_v_lazy_steps = 0;
  PyObject *__pyx_v_wait_until_finish = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("upload_pipe_code_from_file (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_lazy_steps,&__pyx_n_s_wait_until_finish,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_file_path)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lazy_steps);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_wait_until_finish);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "upload_pipe_code_from_file") < 0)) __PYX_ERR(0, 429, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file_path = ((PyObject*)values[0]);
    __pyx_v_lazy_steps = values[1];
    __pyx_v_wait_until_finish = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("upload_pipe_code_from_file", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 429, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.upload_pipe_code_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_path), (&PyString_Type), 0, "file_path", 1))) __PYX_ERR(0, 429, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_30upload_pipe_code_from_file(__pyx_self, __pyx_v_file_path, __pyx_v_lazy_steps, __pyx_v_wait_until_finish);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_30upload_pipe_code_from_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_lazy_steps, PyObject *__pyx_v_wait_until_finish) {
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_code = 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;
  unsigned int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("upload_pipe_code_from_file", 1);

  /* "buelon/cython/c_hub.pyx":430
 * 
 * def upload_pipe_code_from_file(file_path: str, lazy_steps: bool = False, wait_until_finish: bool = False):
 *     with open(file_path, 'r') as f:             # <<<<<<<<<<<<<<
 *         code = f.read()
 *         upload_pipe_code(code, lazy_steps, wait_until_finish)
 */
  /*with:*/ {
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_file_path);
    __Pyx_GIVEREF(__pyx_v_file_path);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_file_path)) __PYX_ERR(0, 430, __pyx_L1_error);
    __Pyx_INCREF(__pyx_n_s_r);
    __Pyx_GIVEREF(__pyx_n_s_r);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_r)) __PYX_ERR(0, 430, __pyx_L1_error);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = __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:*/ {
          __pyx_v_f = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "buelon/cython/c_hub.pyx":431
 * def upload_pipe_code_from_file(file_path: str, lazy_steps: bool = False, wait_until_finish: bool = False):
 *     with open(file_path, 'r') as f:
 *         code = f.read()             # <<<<<<<<<<<<<<
 *         upload_pipe_code(code, lazy_steps, wait_until_finish)
 * 
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __pyx_v_code = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "buelon/cython/c_hub.pyx":432
 *     with open(file_path, 'r') as f:
 *         code = f.read()
 *         upload_pipe_code(code, lazy_steps, wait_until_finish)             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_upload_pipe_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_v_code, __pyx_v_lazy_steps, __pyx_v_wait_until_finish};
            __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "buelon/cython/c_hub.pyx":430
 * 
 * def upload_pipe_code_from_file(file_path: str, lazy_steps: bool = False, wait_until_finish: bool = False):
 *     with open(file_path, 'r') as f:             # <<<<<<<<<<<<<<
 *         code = f.read()
 *         upload_pipe_code(code, lazy_steps, wait_until_finish)
 */
        }
        __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_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("buelon.cython.c_hub.upload_pipe_code_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 430, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_1);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 430, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_11 < 0) __PYX_ERR(0, 430, __pyx_L9_except_error)
          __pyx_t_12 = (!__pyx_t_11);
          if (unlikely(__pyx_t_12)) {
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_2, __pyx_t_1);
            __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; 
            __PYX_ERR(0, 430, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __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_L8_exception_handled:;
        __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_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_3) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__5, NULL);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 430, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "buelon/cython/c_hub.pyx":429
 * 
 * 
 * def upload_pipe_code_from_file(file_path: str, lazy_steps: bool = False, wait_until_finish: bool = False):             # <<<<<<<<<<<<<<
 *     with open(file_path, 'r') as f:
 *         code = f.read()
 */

  /* 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_5);
  __Pyx_AddTraceback("buelon.cython.c_hub.upload_pipe_code_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_code);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":435
 * 
 * 
 * def submit_pipe_code_from_file(file_path: str, scope: str | None = None):             # <<<<<<<<<<<<<<
 *     with open(file_path) as f:
 *         return submit_pipe_code(f.read(), scope)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_33submit_pipe_code_from_file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_33submit_pipe_code_from_file = {"submit_pipe_code_from_file", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_33submit_pipe_code_from_file, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_33submit_pipe_code_from_file(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_file_path = 0;
  PyObject *__pyx_v_scope = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("submit_pipe_code_from_file (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file_path,&__pyx_n_s_scope,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_file_path)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scope);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "submit_pipe_code_from_file") < 0)) __PYX_ERR(0, 435, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file_path = ((PyObject*)values[0]);
    __pyx_v_scope = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("submit_pipe_code_from_file", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 435, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.submit_pipe_code_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_path), (&PyString_Type), 0, "file_path", 1))) __PYX_ERR(0, 435, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_32submit_pipe_code_from_file(__pyx_self, __pyx_v_file_path, __pyx_v_scope);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_32submit_pipe_code_from_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_path, PyObject *__pyx_v_scope) {
  PyObject *__pyx_v_f = 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;
  unsigned 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;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("submit_pipe_code_from_file", 1);

  /* "buelon/cython/c_hub.pyx":436
 * 
 * def submit_pipe_code_from_file(file_path: str, scope: str | None = None):
 *     with open(file_path) as f:             # <<<<<<<<<<<<<<
 *         return submit_pipe_code(f.read(), scope)
 * 
 */
  /*with:*/ {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_open, __pyx_v_file_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = __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_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_f = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "buelon/cython/c_hub.pyx":437
 * def submit_pipe_code_from_file(file_path: str, scope: str | None = None):
 *     with open(file_path) as f:
 *         return submit_pipe_code(f.read(), scope)             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __Pyx_XDECREF(__pyx_r);
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_submit_pipe_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_read); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 437, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_10 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
            __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
          __pyx_t_5 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_scope};
            __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __pyx_r = __pyx_t_4;
          __pyx_t_4 = 0;
          goto __pyx_L11_try_return;

          /* "buelon/cython/c_hub.pyx":436
 * 
 * def submit_pipe_code_from_file(file_path: str, scope: str | None = None):
 *     with open(file_path) as f:             # <<<<<<<<<<<<<<
 *         return submit_pipe_code(f.read(), scope)
 * 
 */
        }
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 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;
        /*except:*/ {
          __Pyx_AddTraceback("buelon.cython.c_hub.submit_pipe_code_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 436, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_3);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 436, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 436, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_12 < 0) __PYX_ERR(0, 436, __pyx_L9_except_error)
          __pyx_t_13 = (!__pyx_t_12);
          if (unlikely(__pyx_t_13)) {
            __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, 436, __pyx_L9_except_error)
          }
          __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;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __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_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_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_2) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 436, __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_2) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 436, __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_L16;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "buelon/cython/c_hub.pyx":435
 * 
 * 
 * def submit_pipe_code_from_file(file_path: str, scope: str | None = None):             # <<<<<<<<<<<<<<
 *     with open(file_path) as f:
 *         return submit_pipe_code(f.read(), scope)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("buelon.cython.c_hub.submit_pipe_code_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":440
 * 
 * 
 * def submit_pipe_code(code: str, scope: str | None = None, priority: int = 0):             # <<<<<<<<<<<<<<
 *     if scope is None:
 *         scope = buelon.worker.DEFAULT_SCOPES.split(',')[-1]
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_84__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 1);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, Py_None)) __PYX_ERR(0, 440, __pyx_L1_error);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_priority);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_priority);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_priority)) __PYX_ERR(0, 440, __pyx_L1_error);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 440, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_35submit_pipe_code(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_35submit_pipe_code = {"submit_pipe_code", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_35submit_pipe_code, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_35submit_pipe_code(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_code = 0;
  PyObject *__pyx_v_scope = 0;
  PyObject *__pyx_v_priority = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("submit_pipe_code (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_code,&__pyx_n_s_scope,&__pyx_n_s_priority,0};
    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_priority);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_code)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scope);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_priority);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "submit_pipe_code") < 0)) __PYX_ERR(0, 440, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_code = ((PyObject*)values[0]);
    __pyx_v_scope = values[1];
    __pyx_v_priority = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("submit_pipe_code", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 440, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.submit_pipe_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_code), (&PyString_Type), 0, "code", 1))) __PYX_ERR(0, 440, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_priority), (&PyInt_Type), 0, "priority", 1))) __PYX_ERR(0, 440, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_34submit_pipe_code(__pyx_self, __pyx_v_code, __pyx_v_scope, __pyx_v_priority);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_34submit_pipe_code(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code, PyObject *__pyx_v_scope, PyObject *__pyx_v_priority) {
  PyObject *__pyx_v_bucket = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("submit_pipe_code", 0);
  __Pyx_INCREF(__pyx_v_code);
  __Pyx_INCREF(__pyx_v_scope);
  __Pyx_INCREF(__pyx_v_priority);

  /* "buelon/cython/c_hub.pyx":441
 * 
 * def submit_pipe_code(code: str, scope: str | None = None, priority: int = 0):
 *     if scope is None:             # <<<<<<<<<<<<<<
 *         scope = buelon.worker.DEFAULT_SCOPES.split(',')[-1]
 *     if not isinstance(priority, int):
 */
  __pyx_t_1 = (__pyx_v_scope == Py_None);
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":442
 * def submit_pipe_code(code: str, scope: str | None = None, priority: int = 0):
 *     if scope is None:
 *         scope = buelon.worker.DEFAULT_SCOPES.split(',')[-1]             # <<<<<<<<<<<<<<
 *     if not isinstance(priority, int):
 *         priority = 0
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_worker); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_DEFAULT_SCOPES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_s__15};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_scope, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":441
 * 
 * def submit_pipe_code(code: str, scope: str | None = None, priority: int = 0):
 *     if scope is None:             # <<<<<<<<<<<<<<
 *         scope = buelon.worker.DEFAULT_SCOPES.split(',')[-1]
 *     if not isinstance(priority, int):
 */
  }

  /* "buelon/cython/c_hub.pyx":443
 *     if scope is None:
 *         scope = buelon.worker.DEFAULT_SCOPES.split(',')[-1]
 *     if not isinstance(priority, int):             # <<<<<<<<<<<<<<
 *         priority = 0
 * 
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_priority); 
  __pyx_t_6 = (!__pyx_t_1);
  if (__pyx_t_6) {

    /* "buelon/cython/c_hub.pyx":444
 *         scope = buelon.worker.DEFAULT_SCOPES.split(',')[-1]
 *     if not isinstance(priority, int):
 *         priority = 0             # <<<<<<<<<<<<<<
 * 
 *     bucket = buelon.bucket.Client()
 */
    if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(0, 444, __pyx_L1_error)
    __pyx_t_4 = __pyx_int_0;
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_priority, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":443
 *     if scope is None:
 *         scope = buelon.worker.DEFAULT_SCOPES.split(',')[-1]
 *     if not isinstance(priority, int):             # <<<<<<<<<<<<<<
 *         priority = 0
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":446
 *         priority = 0
 * 
 *     bucket = buelon.bucket.Client()             # <<<<<<<<<<<<<<
 * 
 *     key = f'submit-jobs/{uuid.uuid1()}'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bucket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_bucket = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":448
 *     bucket = buelon.bucket.Client()
 * 
 *     key = f'submit-jobs/{uuid.uuid1()}'             # <<<<<<<<<<<<<<
 *     bucket.set(key, code.encode())
 *     # Cython does not allow an f-string here
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uuid1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_submit_jobs, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_key = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":449
 * 
 *     key = f'submit-jobs/{uuid.uuid1()}'
 *     bucket.set(key, code.encode())             # <<<<<<<<<<<<<<
 *     # Cython does not allow an f-string here
 *     code = "TAB = '  '\n!scope {scope}\n!priority {priority}\n\njob:\n  python\n  main\n  `\nimport buelon as pete\ndef main(*args):\n    bucket = pete.bucket.Client()\n    code = bucket.get('{key}').decode()\n    pete.hub.upload_pipe_code(code)\n`\n\npipe = | job\npipe()\n"
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_bucket, __pyx_n_s_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyString_Type_encode, __pyx_v_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_key, __pyx_t_2};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __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;

  /* "buelon/cython/c_hub.pyx":451
 *     bucket.set(key, code.encode())
 *     # Cython does not allow an f-string here
 *     code = "TAB = '  '\n!scope {scope}\n!priority {priority}\n\njob:\n  python\n  main\n  `\nimport buelon as pete\ndef main(*args):\n    bucket = pete.bucket.Client()\n    code = bucket.get('{key}').decode()\n    pete.hub.upload_pipe_code(code)\n`\n\npipe = | job\npipe()\n"             # <<<<<<<<<<<<<<
 *     code = code.format(scope=scope, key=key, priority=f'{priority}')
 *     upload_pipe_code(code)
 */
  __Pyx_INCREF(__pyx_kp_s_TAB_scope_scope_priority_priorit);
  __Pyx_DECREF_SET(__pyx_v_code, __pyx_kp_s_TAB_scope_scope_priority_priorit);

  /* "buelon/cython/c_hub.pyx":452
 *     # Cython does not allow an f-string here
 *     code = "TAB = '  '\n!scope {scope}\n!priority {priority}\n\njob:\n  python\n  main\n  `\nimport buelon as pete\ndef main(*args):\n    bucket = pete.bucket.Client()\n    code = bucket.get('{key}').decode()\n    pete.hub.upload_pipe_code(code)\n`\n\npipe = | job\npipe()\n"
 *     code = code.format(scope=scope, key=key, priority=f'{priority}')             # <<<<<<<<<<<<<<
 *     upload_pipe_code(code)
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_code, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_scope, __pyx_v_scope) < 0) __PYX_ERR(0, 452, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_v_key) < 0) __PYX_ERR(0, 452, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_priority, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_priority, __pyx_t_2) < 0) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __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;
  if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_code, ((PyObject*)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":453
 *     code = "TAB = '  '\n!scope {scope}\n!priority {priority}\n\njob:\n  python\n  main\n  `\nimport buelon as pete\ndef main(*args):\n    bucket = pete.bucket.Client()\n    code = bucket.get('{key}').decode()\n    pete.hub.upload_pipe_code(code)\n`\n\npipe = | job\npipe()\n"
 *     code = code.format(scope=scope, key=key, priority=f'{priority}')
 *     upload_pipe_code(code)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_upload_pipe_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_code};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __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;

  /* "buelon/cython/c_hub.pyx":440
 * 
 * 
 * def submit_pipe_code(code: str, scope: str | None = None, priority: int = 0):             # <<<<<<<<<<<<<<
 *     if scope is None:
 *         scope = buelon.worker.DEFAULT_SCOPES.split(',')[-1]
 */

  /* 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_7);
  __Pyx_AddTraceback("buelon.cython.c_hub.submit_pipe_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bucket);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_code);
  __Pyx_XDECREF(__pyx_v_scope);
  __Pyx_XDECREF(__pyx_v_priority);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":456
 * 
 * 
 * def get_step(step_id: str) -> buelon.core.step.Step | None:             # <<<<<<<<<<<<<<
 *     s = buelon.core.step.Step()
 *     b = bucket_client.get(f'step/{step_id}')
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_37get_step(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_37get_step = {"get_step", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_37get_step, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_37get_step(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_step_id = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_step (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step_id,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_id)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_step") < 0)) __PYX_ERR(0, 456, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_step_id = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_step", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 456, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.get_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_id), (&PyString_Type), 0, "step_id", 1))) __PYX_ERR(0, 456, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_36get_step(__pyx_self, __pyx_v_step_id);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_36get_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_v_b = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_step", 1);

  /* "buelon/cython/c_hub.pyx":457
 * 
 * def get_step(step_id: str) -> buelon.core.step.Step | None:
 *     s = buelon.core.step.Step()             # <<<<<<<<<<<<<<
 *     b = bucket_client.get(f'step/{step_id}')
 *     if b is None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __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_Step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_s = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":458
 * def get_step(step_id: str) -> buelon.core.step.Step | None:
 *     s = buelon.core.step.Step()
 *     b = bucket_client.get(f'step/{step_id}')             # <<<<<<<<<<<<<<
 *     if b is None:
 *         return
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_bucket_client); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_step_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_step_3, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_b = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":459
 *     s = buelon.core.step.Step()
 *     b = bucket_client.get(f'step/{step_id}')
 *     if b is None:             # <<<<<<<<<<<<<<
 *         return
 *     data = buelon.helpers.json_parser.loads(b)
 */
  __pyx_t_6 = (__pyx_v_b == Py_None);
  if (__pyx_t_6) {

    /* "buelon/cython/c_hub.pyx":460
 *     b = bucket_client.get(f'step/{step_id}')
 *     if b is None:
 *         return             # <<<<<<<<<<<<<<
 *     data = buelon.helpers.json_parser.loads(b)
 *     return s.from_json(data)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":459
 *     s = buelon.core.step.Step()
 *     b = bucket_client.get(f'step/{step_id}')
 *     if b is None:             # <<<<<<<<<<<<<<
 *         return
 *     data = buelon.helpers.json_parser.loads(b)
 */
  }

  /* "buelon/cython/c_hub.pyx":461
 *     if b is None:
 *         return
 *     data = buelon.helpers.json_parser.loads(b)             # <<<<<<<<<<<<<<
 *     return s.from_json(data)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_helpers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_loads); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_b};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":462
 *         return
 *     data = buelon.helpers.json_parser.loads(b)
 *     return s.from_json(data)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_from_json); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_data};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":456
 * 
 * 
 * def get_step(step_id: str) -> buelon.core.step.Step | None:             # <<<<<<<<<<<<<<
 *     s = buelon.core.step.Step()
 *     b = bucket_client.get(f'step/{step_id}')
 */

  /* 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("buelon.cython.c_hub.get_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":465
 * 
 * 
 * def bulk_get_step(step_ids: list[str]) -> dict[str, buelon.core.step.Step | None]:             # <<<<<<<<<<<<<<
 *     output = bucket_client.bulk_get([f'step/{step_id}' for step_id in step_ids])
 *     new_output = {}
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_39bulk_get_step(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_39bulk_get_step = {"bulk_get_step", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_39bulk_get_step, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_39bulk_get_step(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_step_ids = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bulk_get_step (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step_ids,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_ids)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "bulk_get_step") < 0)) __PYX_ERR(0, 465, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_step_ids = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bulk_get_step", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 465, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.bulk_get_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_ids), (&PyList_Type), 0, "step_ids", 1))) __PYX_ERR(0, 465, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_38bulk_get_step(__pyx_self, __pyx_v_step_ids);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_38bulk_get_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_step_ids) {
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_v_new_output = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_new_key = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_step_id = 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;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bulk_get_step", 1);

  /* "buelon/cython/c_hub.pyx":466
 * 
 * def bulk_get_step(step_ids: list[str]) -> dict[str, buelon.core.step.Step | None]:
 *     output = bucket_client.bulk_get([f'step/{step_id}' for step_id in step_ids])             # <<<<<<<<<<<<<<
 *     new_output = {}
 *     for k in output:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_bucket_client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bulk_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_v_step_ids; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 466, __pyx_L5_error)
        #endif
        if (__pyx_t_5 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 466, __pyx_L5_error)
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_step_id, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_8genexpr4__pyx_v_step_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_step_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 466, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_step_id); __pyx_8genexpr4__pyx_v_step_id = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_step_id); __pyx_8genexpr4__pyx_v_step_id = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_t_4 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_output = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":467
 * def bulk_get_step(step_ids: list[str]) -> dict[str, buelon.core.step.Step | None]:
 *     output = bucket_client.bulk_get([f'step/{step_id}' for step_id in step_ids])
 *     new_output = {}             # <<<<<<<<<<<<<<
 *     for k in output:
 *         new_key = k.split('/')[1]
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_new_output = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":468
 *     output = bucket_client.bulk_get([f'step/{step_id}' for step_id in step_ids])
 *     new_output = {}
 *     for k in output:             # <<<<<<<<<<<<<<
 *         new_key = k.split('/')[1]
 *         if output[k] is None:
 */
  if (likely(PyList_CheckExact(__pyx_v_output)) || PyTuple_CheckExact(__pyx_v_output)) {
    __pyx_t_1 = __pyx_v_output; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_output); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 468, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 468, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 468, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 468, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 468, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 468, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_9(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 468, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":469
 *     new_output = {}
 *     for k in output:
 *         new_key = k.split('/')[1]             # <<<<<<<<<<<<<<
 *         if output[k] is None:
 *             new_output[new_key] = None
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s__20};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "buelon/cython/c_hub.pyx":470
 *     for k in output:
 *         new_key = k.split('/')[1]
 *         if output[k] is None:             # <<<<<<<<<<<<<<
 *             new_output[new_key] = None
 *             continue
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_output, __pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = (__pyx_t_2 == Py_None);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_10) {

      /* "buelon/cython/c_hub.pyx":471
 *         new_key = k.split('/')[1]
 *         if output[k] is None:
 *             new_output[new_key] = None             # <<<<<<<<<<<<<<
 *             continue
 *         s = buelon.core.step.Step()
 */
      if (unlikely((PyDict_SetItem(__pyx_v_new_output, __pyx_v_new_key, Py_None) < 0))) __PYX_ERR(0, 471, __pyx_L1_error)

      /* "buelon/cython/c_hub.pyx":472
 *         if output[k] is None:
 *             new_output[new_key] = None
 *             continue             # <<<<<<<<<<<<<<
 *         s = buelon.core.step.Step()
 *         new_output[new_key] = s.from_json(buelon.helpers.json_parser.loads(output[k]))
 */
      goto __pyx_L10_continue;

      /* "buelon/cython/c_hub.pyx":470
 *     for k in output:
 *         new_key = k.split('/')[1]
 *         if output[k] is None:             # <<<<<<<<<<<<<<
 *             new_output[new_key] = None
 *             continue
 */
    }

    /* "buelon/cython/c_hub.pyx":473
 *             new_output[new_key] = None
 *             continue
 *         s = buelon.core.step.Step()             # <<<<<<<<<<<<<<
 *         new_output[new_key] = s.from_json(buelon.helpers.json_parser.loads(output[k]))
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "buelon/cython/c_hub.pyx":474
 *             continue
 *         s = buelon.core.step.Step()
 *         new_output[new_key] = s.from_json(buelon.helpers.json_parser.loads(output[k]))             # <<<<<<<<<<<<<<
 * 
 *     return new_output
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_from_json); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_buelon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_loads); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_output, __pyx_v_k); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_11 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (unlikely((PyDict_SetItem(__pyx_v_new_output, __pyx_v_new_key, __pyx_t_2) < 0))) __PYX_ERR(0, 474, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "buelon/cython/c_hub.pyx":468
 *     output = bucket_client.bulk_get([f'step/{step_id}' for step_id in step_ids])
 *     new_output = {}
 *     for k in output:             # <<<<<<<<<<<<<<
 *         new_key = k.split('/')[1]
 *         if output[k] is None:
 */
    __pyx_L10_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":476
 *         new_output[new_key] = s.from_json(buelon.helpers.json_parser.loads(output[k]))
 * 
 *     return new_output             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_new_output);
  __pyx_r = __pyx_v_new_output;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":465
 * 
 * 
 * def bulk_get_step(step_ids: list[str]) -> dict[str, buelon.core.step.Step | None]:             # <<<<<<<<<<<<<<
 *     output = bucket_client.bulk_get([f'step/{step_id}' for step_id in step_ids])
 *     new_output = {}
 */

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("buelon.cython.c_hub.bulk_get_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XDECREF(__pyx_v_new_output);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_new_key);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_step_id);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":479
 * 
 * 
 * def set_step(_step: buelon.core.step.Step) -> None:             # <<<<<<<<<<<<<<
 *     b = buelon.helpers.json_parser.dumps(_step.to_json())
 *     bucket_client.set(f'step/{_step.id}', b)
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_40set_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v__step) {
  PyObject *__pyx_v_b = 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;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_step", 1);

  /* "buelon/cython/c_hub.pyx":480
 * 
 * def set_step(_step: buelon.core.step.Step) -> None:
 *     b = buelon.helpers.json_parser.dumps(_step.to_json())             # <<<<<<<<<<<<<<
 *     bucket_client.set(f'step/{_step.id}', b)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_helpers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __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_dumps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_to_json); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_b = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":481
 * def set_step(_step: buelon.core.step.Step) -> None:
 *     b = buelon.helpers.json_parser.dumps(_step.to_json())
 *     bucket_client.set(f'step/{_step.id}', b)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_bucket_client); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_step_3, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_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;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_b};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __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;

  /* "buelon/cython/c_hub.pyx":479
 * 
 * 
 * def set_step(_step: buelon.core.step.Step) -> None:             # <<<<<<<<<<<<<<
 *     b = buelon.helpers.json_parser.dumps(_step.to_json())
 *     bucket_client.set(f'step/{_step.id}', b)
 */

  /* 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("buelon.cython.c_hub.set_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":484
 * 
 * 
 * def set_steps(steps: list[buelon.core.step.Step]) -> None:             # <<<<<<<<<<<<<<
 *     # if not buelon.bucket.USING_POSTGRES and not buelon.bucket.USING_REDIS:
 *     #     # raise ValueError('set_steps only works with postgres and redis')
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_43set_steps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_43set_steps = {"set_steps", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_43set_steps, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_43set_steps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_steps = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_steps (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_steps,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_steps)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_steps") < 0)) __PYX_ERR(0, 484, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_steps = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_steps", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 484, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.set_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_steps), (&PyList_Type), 0, "steps", 1))) __PYX_ERR(0, 484, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_42set_steps(__pyx_self, __pyx_v_steps);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_42set_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_steps) {
  PyObject *__pyx_v_bulk = NULL;
  PyObject *__pyx_v__step = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_steps", 1);

  /* "buelon/cython/c_hub.pyx":491
 *     #     return
 * 
 *     bulk = {}             # <<<<<<<<<<<<<<
 *     for _step in steps:
 *         # set_step(_step)
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_bulk = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":492
 * 
 *     bulk = {}
 *     for _step in steps:             # <<<<<<<<<<<<<<
 *         # set_step(_step)
 *         bulk[f'step/{_step.id}'] = buelon.helpers.json_parser.dumps(_step.to_json())
 */
  __pyx_t_1 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 492, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 492, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v__step, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":494
 *     for _step in steps:
 *         # set_step(_step)
 *         bulk[f'step/{_step.id}'] = buelon.helpers.json_parser.dumps(_step.to_json())             # <<<<<<<<<<<<<<
 * 
 *     bucket_client.bulk_set(bulk, True)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_buelon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_helpers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dumps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_to_json); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_step_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely((PyDict_SetItem(__pyx_v_bulk, __pyx_t_5, __pyx_t_3) < 0))) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":492
 * 
 *     bulk = {}
 *     for _step in steps:             # <<<<<<<<<<<<<<
 *         # set_step(_step)
 *         bulk[f'step/{_step.id}'] = buelon.helpers.json_parser.dumps(_step.to_json())
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":496
 *         bulk[f'step/{_step.id}'] = buelon.helpers.json_parser.dumps(_step.to_json())
 * 
 *     bucket_client.bulk_set(bulk, True)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_bucket_client); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bulk_set); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_bulk, Py_True};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":484
 * 
 * 
 * def set_steps(steps: list[buelon.core.step.Step]) -> None:             # <<<<<<<<<<<<<<
 *     # if not buelon.bucket.USING_POSTGRES and not buelon.bucket.USING_REDIS:
 *     #     # raise ValueError('set_steps only works with postgres and redis')
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("buelon.cython.c_hub.set_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bulk);
  __Pyx_XDECREF(__pyx_v__step);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":499
 * 
 * 
 * def remove_step(step_id: str) -> None:             # <<<<<<<<<<<<<<
 *     bucket_client.delete(f'step/{step_id}')
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_45remove_step(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_45remove_step = {"remove_step", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_45remove_step, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_45remove_step(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_step_id = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_step (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step_id,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_id)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 499, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "remove_step") < 0)) __PYX_ERR(0, 499, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_step_id = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("remove_step", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 499, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.remove_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_id), (&PyString_Type), 0, "step_id", 1))) __PYX_ERR(0, 499, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_44remove_step(__pyx_self, __pyx_v_step_id);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_44remove_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("remove_step", 1);

  /* "buelon/cython/c_hub.pyx":500
 * 
 * def remove_step(step_id: str) -> None:
 *     bucket_client.delete(f'step/{step_id}')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_bucket_client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_delete); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_step_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_step_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __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_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __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;

  /* "buelon/cython/c_hub.pyx":499
 * 
 * 
 * def remove_step(step_id: str) -> None:             # <<<<<<<<<<<<<<
 *     bucket_client.delete(f'step/{step_id}')
 * 
 */

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

/* "buelon/cython/c_hub.pyx":503
 * 
 * 
 * def get_data(step_id: str) -> Any:             # <<<<<<<<<<<<<<
 *     key = f'step-data/{step_id}'
 *     v = bucket_client.get(key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_47get_data(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_47get_data = {"get_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_47get_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_47get_data(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_step_id = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step_id,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_id)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_data") < 0)) __PYX_ERR(0, 503, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_step_id = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_data", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 503, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.get_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_id), (&PyString_Type), 0, "step_id", 1))) __PYX_ERR(0, 503, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_46get_data(__pyx_self, __pyx_v_step_id);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_46get_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_data", 1);

  /* "buelon/cython/c_hub.pyx":504
 * 
 * def get_data(step_id: str) -> Any:
 *     key = f'step-data/{step_id}'             # <<<<<<<<<<<<<<
 *     v = bucket_client.get(key)
 *     if v is None:
 */
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_step_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_step_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_key = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":505
 * def get_data(step_id: str) -> Any:
 *     key = f'step-data/{step_id}'
 *     v = bucket_client.get(key)             # <<<<<<<<<<<<<<
 *     if v is None:
 *         # _reset(step_id)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_bucket_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_key};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_v = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":506
 *     key = f'step-data/{step_id}'
 *     v = bucket_client.get(key)
 *     if v is None:             # <<<<<<<<<<<<<<
 *         # _reset(step_id)
 *         raise ValueError(f'No data found for step {step_id}')
 */
  __pyx_t_5 = (__pyx_v_v == Py_None);
  if (unlikely(__pyx_t_5)) {

    /* "buelon/cython/c_hub.pyx":508
 *     if v is None:
 *         # _reset(step_id)
 *         raise ValueError(f'No data found for step {step_id}')             # <<<<<<<<<<<<<<
 *     return buelon.helpers.json_parser.loads(v)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_step_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_No_data_found_for_step, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __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, 508, __pyx_L1_error)

    /* "buelon/cython/c_hub.pyx":506
 *     key = f'step-data/{step_id}'
 *     v = bucket_client.get(key)
 *     if v is None:             # <<<<<<<<<<<<<<
 *         # _reset(step_id)
 *         raise ValueError(f'No data found for step {step_id}')
 */
  }

  /* "buelon/cython/c_hub.pyx":509
 *         # _reset(step_id)
 *         raise ValueError(f'No data found for step {step_id}')
 *     return buelon.helpers.json_parser.loads(v)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_helpers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_loads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_v};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __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;

  /* "buelon/cython/c_hub.pyx":503
 * 
 * 
 * def get_data(step_id: str) -> Any:             # <<<<<<<<<<<<<<
 *     key = f'step-data/{step_id}'
 *     v = bucket_client.get(key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("buelon.cython.c_hub.get_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":512
 * 
 * 
 * def bulk_get_data(step_ids: list[str]) -> Any:             # <<<<<<<<<<<<<<
 *     output = bucket_client.bulk_get([f'step-data/{step_id}' for step_id in step_ids])
 *     new_output = {}
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_49bulk_get_data(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_49bulk_get_data = {"bulk_get_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_49bulk_get_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_49bulk_get_data(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_step_ids = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bulk_get_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step_ids,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_ids)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "bulk_get_data") < 0)) __PYX_ERR(0, 512, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_step_ids = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bulk_get_data", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 512, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.bulk_get_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_ids), (&PyList_Type), 0, "step_ids", 1))) __PYX_ERR(0, 512, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_48bulk_get_data(__pyx_self, __pyx_v_step_ids);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_48bulk_get_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_step_ids) {
  PyObject *__pyx_v_output = NULL;
  PyObject *__pyx_v_new_output = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_step_id = NULL;
  PyObject *__pyx_8genexpr5__pyx_v_step_id = 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;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bulk_get_data", 1);

  /* "buelon/cython/c_hub.pyx":513
 * 
 * def bulk_get_data(step_ids: list[str]) -> Any:
 *     output = bucket_client.bulk_get([f'step-data/{step_id}' for step_id in step_ids])             # <<<<<<<<<<<<<<
 *     new_output = {}
 *     for k, v in output.items():
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_bucket_client); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bulk_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __pyx_v_step_ids; __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 513, __pyx_L5_error)
        #endif
        if (__pyx_t_5 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 513, __pyx_L5_error)
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_step_id, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_8genexpr5__pyx_v_step_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_step_data, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 513, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_step_id); __pyx_8genexpr5__pyx_v_step_id = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_step_id); __pyx_8genexpr5__pyx_v_step_id = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_t_4 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_output = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":514
 * def bulk_get_data(step_ids: list[str]) -> Any:
 *     output = bucket_client.bulk_get([f'step-data/{step_id}' for step_id in step_ids])
 *     new_output = {}             # <<<<<<<<<<<<<<
 *     for k, v in output.items():
 *         step_id = k.split('/')[1]
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_new_output = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":515
 *     output = bucket_client.bulk_get([f'step-data/{step_id}' for step_id in step_ids])
 *     new_output = {}
 *     for k, v in output.items():             # <<<<<<<<<<<<<<
 *         step_id = k.split('/')[1]
 *         if v is None:
 */
  __pyx_t_5 = 0;
  if (unlikely(__pyx_v_output == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(0, 515, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_output, 0, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  while (1) {
    __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_5, &__pyx_t_3, &__pyx_t_2, NULL, __pyx_t_10);
    if (unlikely(__pyx_t_11 == 0)) break;
    if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "buelon/cython/c_hub.pyx":516
 *     new_output = {}
 *     for k, v in output.items():
 *         step_id = k.split('/')[1]             # <<<<<<<<<<<<<<
 *         if v is None:
 *             raise ValueError(f'No data found for step {step_id}')
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s__20};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_step_id, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":517
 *     for k, v in output.items():
 *         step_id = k.split('/')[1]
 *         if v is None:             # <<<<<<<<<<<<<<
 *             raise ValueError(f'No data found for step {step_id}')
 *         new_output[step_id] = buelon.helpers.json_parser.loads(v)
 */
    __pyx_t_12 = (__pyx_v_v == Py_None);
    if (unlikely(__pyx_t_12)) {

      /* "buelon/cython/c_hub.pyx":518
 *         step_id = k.split('/')[1]
 *         if v is None:
 *             raise ValueError(f'No data found for step {step_id}')             # <<<<<<<<<<<<<<
 *         new_output[step_id] = buelon.helpers.json_parser.loads(v)
 *     return output
 */
      __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_step_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_No_data_found_for_step, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __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, 518, __pyx_L1_error)

      /* "buelon/cython/c_hub.pyx":517
 *     for k, v in output.items():
 *         step_id = k.split('/')[1]
 *         if v is None:             # <<<<<<<<<<<<<<
 *             raise ValueError(f'No data found for step {step_id}')
 *         new_output[step_id] = buelon.helpers.json_parser.loads(v)
 */
    }

    /* "buelon/cython/c_hub.pyx":519
 *         if v is None:
 *             raise ValueError(f'No data found for step {step_id}')
 *         new_output[step_id] = buelon.helpers.json_parser.loads(v)             # <<<<<<<<<<<<<<
 *     return output
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_helpers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_loads); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_v};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    if (unlikely((PyDict_SetItem(__pyx_v_new_output, __pyx_v_step_id, __pyx_t_3) < 0))) __PYX_ERR(0, 519, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":520
 *             raise ValueError(f'No data found for step {step_id}')
 *         new_output[step_id] = buelon.helpers.json_parser.loads(v)
 *     return output             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_output);
  __pyx_r = __pyx_v_output;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":512
 * 
 * 
 * def bulk_get_data(step_ids: list[str]) -> Any:             # <<<<<<<<<<<<<<
 *     output = bucket_client.bulk_get([f'step-data/{step_id}' for step_id in step_ids])
 *     new_output = {}
 */

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("buelon.cython.c_hub.bulk_get_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_output);
  __Pyx_XDECREF(__pyx_v_new_output);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_step_id);
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_step_id);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":523
 * 
 * 
 * def set_data(step_id: str, data: Any) -> None:             # <<<<<<<<<<<<<<
 *     key = f'step-data/{step_id}'
 *     b = buelon.helpers.json_parser.dumps(data)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_51set_data(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_51set_data = {"set_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_51set_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_51set_data(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_step_id = 0;
  PyObject *__pyx_v_data = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step_id,&__pyx_n_s_data,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_id)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("set_data", 1, 2, 2, 1); __PYX_ERR(0, 523, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_data") < 0)) __PYX_ERR(0, 523, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_step_id = ((PyObject*)values[0]);
    __pyx_v_data = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_data", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 523, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.set_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_id), (&PyString_Type), 0, "step_id", 1))) __PYX_ERR(0, 523, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_50set_data(__pyx_self, __pyx_v_step_id, __pyx_v_data);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_50set_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_data) {
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_b = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_data", 1);

  /* "buelon/cython/c_hub.pyx":524
 * 
 * def set_data(step_id: str, data: Any) -> None:
 *     key = f'step-data/{step_id}'             # <<<<<<<<<<<<<<
 *     b = buelon.helpers.json_parser.dumps(data)
 *     bucket_client.set(key, b)
 */
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_step_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_step_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_key = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":525
 * def set_data(step_id: str, data: Any) -> None:
 *     key = f'step-data/{step_id}'
 *     b = buelon.helpers.json_parser.dumps(data)             # <<<<<<<<<<<<<<
 *     bucket_client.set(key, b)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_buelon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_helpers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dumps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_data};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_b = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":526
 *     key = f'step-data/{step_id}'
 *     b = buelon.helpers.json_parser.dumps(data)
 *     bucket_client.set(key, b)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_bucket_client); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_key, __pyx_v_b};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":523
 * 
 * 
 * def set_data(step_id: str, data: Any) -> None:             # <<<<<<<<<<<<<<
 *     key = f'step-data/{step_id}'
 *     b = buelon.helpers.json_parser.dumps(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_AddTraceback("buelon.cython.c_hub.set_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":529
 * 
 * 
 * def bulk_set_data(bulk: dict[str, Any]) -> None:             # <<<<<<<<<<<<<<
 *     new_bulk = {}
 *     for step_id in bulk:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_53bulk_set_data(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_53bulk_set_data = {"bulk_set_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_53bulk_set_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_53bulk_set_data(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_bulk = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bulk_set_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bulk,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bulk)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 529, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "bulk_set_data") < 0)) __PYX_ERR(0, 529, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_bulk = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bulk_set_data", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 529, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.bulk_set_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bulk), (&PyDict_Type), 0, "bulk", 1))) __PYX_ERR(0, 529, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_52bulk_set_data(__pyx_self, __pyx_v_bulk);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_52bulk_set_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bulk) {
  PyObject *__pyx_v_new_bulk = NULL;
  PyObject *__pyx_v_step_id = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bulk_set_data", 1);

  /* "buelon/cython/c_hub.pyx":530
 * 
 * def bulk_set_data(bulk: dict[str, Any]) -> None:
 *     new_bulk = {}             # <<<<<<<<<<<<<<
 *     for step_id in bulk:
 *         new_bulk[f'step-data/{step_id}'] = buelon.helpers.json_parser.dumps(bulk[step_id])
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_new_bulk = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":531
 * def bulk_set_data(bulk: dict[str, Any]) -> None:
 *     new_bulk = {}
 *     for step_id in bulk:             # <<<<<<<<<<<<<<
 *         new_bulk[f'step-data/{step_id}'] = buelon.helpers.json_parser.dumps(bulk[step_id])
 *     bucket_client.bulk_set(new_bulk)
 */
  __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_bulk, 1, ((PyObject *)NULL), (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_5 = 0;
  while (1) {
    __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, NULL, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_6 == 0)) break;
    if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_step_id, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":532
 *     new_bulk = {}
 *     for step_id in bulk:
 *         new_bulk[f'step-data/{step_id}'] = buelon.helpers.json_parser.dumps(bulk[step_id])             # <<<<<<<<<<<<<<
 *     bucket_client.bulk_set(new_bulk)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_buelon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_helpers); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dumps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_bulk, __pyx_v_step_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_step_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_step_data, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely((PyDict_SetItem(__pyx_v_new_bulk, __pyx_t_7, __pyx_t_5) < 0))) __PYX_ERR(0, 532, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":533
 *     for step_id in bulk:
 *         new_bulk[f'step-data/{step_id}'] = buelon.helpers.json_parser.dumps(bulk[step_id])
 *     bucket_client.bulk_set(new_bulk)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_bucket_client); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_bulk_set); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_10 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_10 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_new_bulk};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":529
 * 
 * 
 * def bulk_set_data(bulk: dict[str, Any]) -> None:             # <<<<<<<<<<<<<<
 *     new_bulk = {}
 *     for step_id in bulk:
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("buelon.cython.c_hub.bulk_set_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_new_bulk);
  __Pyx_XDECREF(__pyx_v_step_id);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":536
 * 
 * 
 * def remove_data(step_id: str) -> None:             # <<<<<<<<<<<<<<
 *     key = f'step-data/{step_id}'
 *     bucket_client.delete(key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_55remove_data(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_55remove_data = {"remove_data", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_55remove_data, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_55remove_data(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_step_id = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_data (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step_id,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_id)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 536, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "remove_data") < 0)) __PYX_ERR(0, 536, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_step_id = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("remove_data", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 536, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.remove_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_id), (&PyString_Type), 0, "step_id", 1))) __PYX_ERR(0, 536, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_54remove_data(__pyx_self, __pyx_v_step_id);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_54remove_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("remove_data", 1);

  /* "buelon/cython/c_hub.pyx":537
 * 
 * def remove_data(step_id: str) -> None:
 *     key = f'step-data/{step_id}'             # <<<<<<<<<<<<<<
 *     bucket_client.delete(key)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_step_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_step_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_key = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":538
 * def remove_data(step_id: str) -> None:
 *     key = f'step-data/{step_id}'
 *     bucket_client.delete(key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_bucket_client); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_delete); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_key};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __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;

  /* "buelon/cython/c_hub.pyx":536
 * 
 * 
 * def remove_data(step_id: str) -> None:             # <<<<<<<<<<<<<<
 *     key = f'step-data/{step_id}'
 *     bucket_client.delete(key)
 */

  /* 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("buelon.cython.c_hub.remove_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":541
 * 
 * 
 * def check_to_delete_bucket_files(             # <<<<<<<<<<<<<<
 *         self: HubServer,
 *         step_id: str,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_57check_to_delete_bucket_files(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_57check_to_delete_bucket_files = {"check_to_delete_bucket_files", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_57check_to_delete_bucket_files, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_57check_to_delete_bucket_files(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_step_id = 0;
  PyObject *__pyx_v_already = 0;
  PyObject *__pyx_v_steps = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_to_delete_bucket_files (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_step_id,&__pyx_n_s_already,&__pyx_n_s_steps,0};

    /* "buelon/cython/c_hub.pyx":544
 *         self: HubServer,
 *         step_id: str,
 *         already: set | None = None,             # <<<<<<<<<<<<<<
 *         steps: list | None = None
 * ) -> None:
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "buelon/cython/c_hub.pyx":545
 *         step_id: str,
 *         already: set | None = None,
 *         steps: list | None = None             # <<<<<<<<<<<<<<
 * ) -> None:
 *     _check_to_delete_bucket_files(self, step_id, already, steps)
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_id)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("check_to_delete_bucket_files", 0, 2, 4, 1); __PYX_ERR(0, 541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_already);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_steps);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "check_to_delete_bucket_files") < 0)) __PYX_ERR(0, 541, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_step_id = ((PyObject*)values[1]);
    __pyx_v_already = values[2];
    __pyx_v_steps = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("check_to_delete_bucket_files", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 541, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.check_to_delete_bucket_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_id), (&PyString_Type), 0, "step_id", 1))) __PYX_ERR(0, 543, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_56check_to_delete_bucket_files(__pyx_self, __pyx_v_self, __pyx_v_step_id, __pyx_v_already, __pyx_v_steps);

  /* "buelon/cython/c_hub.pyx":541
 * 
 * 
 * def check_to_delete_bucket_files(             # <<<<<<<<<<<<<<
 *         self: HubServer,
 *         step_id: str,
 */

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_56check_to_delete_bucket_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_already, PyObject *__pyx_v_steps) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_to_delete_bucket_files", 1);

  /* "buelon/cython/c_hub.pyx":547
 *         steps: list | None = None
 * ) -> None:
 *     _check_to_delete_bucket_files(self, step_id, already, steps)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_to_delete_bucket_files); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_self, __pyx_v_step_id, __pyx_v_already, __pyx_v_steps};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __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;

  /* "buelon/cython/c_hub.pyx":541
 * 
 * 
 * def check_to_delete_bucket_files(             # <<<<<<<<<<<<<<
 *         self: HubServer,
 *         step_id: str,
 */

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

/* "buelon/cython/c_hub.pyx":550
 * 
 * 
 * def _check_to_delete_bucket_files(             # <<<<<<<<<<<<<<
 *     self: HubServer,
 *     step_id: str,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_59_check_to_delete_bucket_files(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_59_check_to_delete_bucket_files = {"_check_to_delete_bucket_files", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_59_check_to_delete_bucket_files, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_59_check_to_delete_bucket_files(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_step_id = 0;
  PyObject *__pyx_v_already = 0;
  PyObject *__pyx_v_steps = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_to_delete_bucket_files (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_step_id,&__pyx_n_s_already,&__pyx_n_s_steps,0};

    /* "buelon/cython/c_hub.pyx":553
 *     self: HubServer,
 *     step_id: str,
 *     already: set | None = None,             # <<<<<<<<<<<<<<
 *     steps: list | None = None
 * ) -> None:
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));

    /* "buelon/cython/c_hub.pyx":554
 *     step_id: str,
 *     already: set | None = None,
 *     steps: list | None = None             # <<<<<<<<<<<<<<
 * ) -> None:
 *     first_iteration = already is None and steps is None
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_id)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_check_to_delete_bucket_files", 0, 2, 4, 1); __PYX_ERR(0, 550, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_already);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_steps);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_check_to_delete_bucket_files") < 0)) __PYX_ERR(0, 550, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_step_id = ((PyObject*)values[1]);
    __pyx_v_already = values[2];
    __pyx_v_steps = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_to_delete_bucket_files", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 550, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub._check_to_delete_bucket_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_id), (&PyString_Type), 0, "step_id", 1))) __PYX_ERR(0, 552, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_58_check_to_delete_bucket_files(__pyx_self, __pyx_v_self, __pyx_v_step_id, __pyx_v_already, __pyx_v_steps);

  /* "buelon/cython/c_hub.pyx":550
 * 
 * 
 * def _check_to_delete_bucket_files(             # <<<<<<<<<<<<<<
 *     self: HubServer,
 *     step_id: str,
 */

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_58_check_to_delete_bucket_files(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_already, PyObject *__pyx_v_steps) {
  PyObject *__pyx_v_first_iteration = NULL;
  PyObject *__pyx_v__step = NULL;
  PyObject *__pyx_v_parent = NULL;
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_v_ids = NULL;
  PyObject *__pyx_v_finished_statuses = NULL;
  PyObject *__pyx_v_sql = NULL;
  PyObject *__pyx_v_rows = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_8genexpr6__pyx_v_s = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_v = NULL;
  PyObject *__pyx_8genexpr8__pyx_v_row = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_UCS4 __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_to_delete_bucket_files", 0);
  __Pyx_INCREF(__pyx_v_already);
  __Pyx_INCREF(__pyx_v_steps);

  /* "buelon/cython/c_hub.pyx":556
 *     steps: list | None = None
 * ) -> None:
 *     first_iteration = already is None and steps is None             # <<<<<<<<<<<<<<
 *     _step = get_step(step_id)
 *     already = set() if first_iteration else already
 */
  __pyx_t_2 = (__pyx_v_already == Py_None);
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_steps == Py_None);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_first_iteration = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":557
 * ) -> None:
 *     first_iteration = already is None and steps is None
 *     _step = get_step(step_id)             # <<<<<<<<<<<<<<
 *     already = set() if first_iteration else already
 *     steps = [] if first_iteration else steps
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_step_id};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v__step = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":558
 *     first_iteration = already is None and steps is None
 *     _step = get_step(step_id)
 *     already = set() if first_iteration else already             # <<<<<<<<<<<<<<
 *     steps = [] if first_iteration else steps
 *     already.add(_step.id)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_first_iteration); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 558, __pyx_L1_error)
  if (__pyx_t_2) {
    __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_already);
    __pyx_t_1 = __pyx_v_already;
  }
  __Pyx_DECREF_SET(__pyx_v_already, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":559
 *     _step = get_step(step_id)
 *     already = set() if first_iteration else already
 *     steps = [] if first_iteration else steps             # <<<<<<<<<<<<<<
 *     already.add(_step.id)
 *     steps.append(_step)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_first_iteration); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 559, __pyx_L1_error)
  if (__pyx_t_2) {
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_steps);
    __pyx_t_1 = __pyx_v_steps;
  }
  __Pyx_DECREF_SET(__pyx_v_steps, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":560
 *     already = set() if first_iteration else already
 *     steps = [] if first_iteration else steps
 *     already.add(_step.id)             # <<<<<<<<<<<<<<
 *     steps.append(_step)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_already, __pyx_n_s_add); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __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;

  /* "buelon/cython/c_hub.pyx":561
 *     steps = [] if first_iteration else steps
 *     already.add(_step.id)
 *     steps.append(_step)             # <<<<<<<<<<<<<<
 * 
 *     if _step.parents:
 */
  __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_steps, __pyx_v__step); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 561, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":563
 *     steps.append(_step)
 * 
 *     if _step.parents:             # <<<<<<<<<<<<<<
 *         for parent in _step.parents:
 *             if parent not in already:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_parents); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __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, 563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":564
 * 
 *     if _step.parents:
 *         for parent in _step.parents:             # <<<<<<<<<<<<<<
 *             if parent not in already:
 *                 already.add(parent)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_parents); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    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_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 564, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 564, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 564, __pyx_L1_error)
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 564, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 564, __pyx_L1_error)
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_9(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 564, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_parent, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "buelon/cython/c_hub.pyx":565
 *     if _step.parents:
 *         for parent in _step.parents:
 *             if parent not in already:             # <<<<<<<<<<<<<<
 *                 already.add(parent)
 *                 # check_to_delete_bucket_files(parent, already, steps)
 */
      __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_parent, __pyx_v_already, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 565, __pyx_L1_error)
      if (__pyx_t_2) {

        /* "buelon/cython/c_hub.pyx":566
 *         for parent in _step.parents:
 *             if parent not in already:
 *                 already.add(parent)             # <<<<<<<<<<<<<<
 *                 # check_to_delete_bucket_files(parent, already, steps)
 *                 check_to_delete_bucket_files(self, parent, already, steps)
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_already, __pyx_n_s_add); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_parent};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "buelon/cython/c_hub.pyx":568
 *                 already.add(parent)
 *                 # check_to_delete_bucket_files(parent, already, steps)
 *                 check_to_delete_bucket_files(self, parent, already, steps)             # <<<<<<<<<<<<<<
 * 
 *     if _step.children:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_to_delete_bucket_files_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_v_self, __pyx_v_parent, __pyx_v_already, __pyx_v_steps};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "buelon/cython/c_hub.pyx":565
 *     if _step.parents:
 *         for parent in _step.parents:
 *             if parent not in already:             # <<<<<<<<<<<<<<
 *                 already.add(parent)
 *                 # check_to_delete_bucket_files(parent, already, steps)
 */
      }

      /* "buelon/cython/c_hub.pyx":564
 * 
 *     if _step.parents:
 *         for parent in _step.parents:             # <<<<<<<<<<<<<<
 *             if parent not in already:
 *                 already.add(parent)
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":563
 *     steps.append(_step)
 * 
 *     if _step.parents:             # <<<<<<<<<<<<<<
 *         for parent in _step.parents:
 *             if parent not in already:
 */
  }

  /* "buelon/cython/c_hub.pyx":570
 *                 check_to_delete_bucket_files(self, parent, already, steps)
 * 
 *     if _step.children:             # <<<<<<<<<<<<<<
 *         for child in _step.children:
 *             if child not in already:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __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, 570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":571
 * 
 *     if _step.children:
 *         for child in _step.children:             # <<<<<<<<<<<<<<
 *             if child not in already:
 *                 already.add(child)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 571, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 571, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 571, __pyx_L1_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 571, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 571, __pyx_L1_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_9(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 571, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "buelon/cython/c_hub.pyx":572
 *     if _step.children:
 *         for child in _step.children:
 *             if child not in already:             # <<<<<<<<<<<<<<
 *                 already.add(child)
 *                 # check_to_delete_bucket_files(child, already, steps)
 */
      __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_child, __pyx_v_already, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 572, __pyx_L1_error)
      if (__pyx_t_2) {

        /* "buelon/cython/c_hub.pyx":573
 *         for child in _step.children:
 *             if child not in already:
 *                 already.add(child)             # <<<<<<<<<<<<<<
 *                 # check_to_delete_bucket_files(child, already, steps)
 *                 check_to_delete_bucket_files(self, child, already, steps)
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_already, __pyx_n_s_add); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 573, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_child};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "buelon/cython/c_hub.pyx":575
 *                 already.add(child)
 *                 # check_to_delete_bucket_files(child, already, steps)
 *                 check_to_delete_bucket_files(self, child, already, steps)             # <<<<<<<<<<<<<<
 * 
 *     if first_iteration:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_to_delete_bucket_files_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_v_self, __pyx_v_child, __pyx_v_already, __pyx_v_steps};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "buelon/cython/c_hub.pyx":572
 *     if _step.children:
 *         for child in _step.children:
 *             if child not in already:             # <<<<<<<<<<<<<<
 *                 already.add(child)
 *                 # check_to_delete_bucket_files(child, already, steps)
 */
      }

      /* "buelon/cython/c_hub.pyx":571
 * 
 *     if _step.children:
 *         for child in _step.children:             # <<<<<<<<<<<<<<
 *             if child not in already:
 *                 already.add(child)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":570
 *                 check_to_delete_bucket_files(self, parent, already, steps)
 * 
 *     if _step.children:             # <<<<<<<<<<<<<<
 *         for child in _step.children:
 *             if child not in already:
 */
  }

  /* "buelon/cython/c_hub.pyx":577
 *                 check_to_delete_bucket_files(self, child, already, steps)
 * 
 *     if first_iteration:             # <<<<<<<<<<<<<<
 *         ids = [s.id for s in steps]
 *         finished_statuses = {f'{v}' for v in [buelon.core.step.StepStatus.cancel.value, buelon.core.step.StepStatus.success.value]}
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_first_iteration); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 577, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":578
 * 
 *     if first_iteration:
 *         ids = [s.id for s in steps]             # <<<<<<<<<<<<<<
 *         finished_statuses = {f'{v}' for v in [buelon.core.step.StepStatus.cancel.value, buelon.core.step.StepStatus.success.value]}
 *         sql = f'SELECT status FROM steps WHERE id IN ({", ".join("?" * len(ids))})'
 */
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_steps)) || PyTuple_CheckExact(__pyx_v_steps)) {
        __pyx_t_3 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_3);
        __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_steps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 578, __pyx_L18_error)
      }
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 578, __pyx_L18_error)
              #endif
              if (__pyx_t_8 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 578, __pyx_L18_error)
            #else
            __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 578, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 578, __pyx_L18_error)
              #endif
              if (__pyx_t_8 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 578, __pyx_L18_error)
            #else
            __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 578, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_9(__pyx_t_3);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 578, __pyx_L18_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_s, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr6__pyx_v_s, __pyx_n_s_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 578, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 578, __pyx_L18_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_s); __pyx_8genexpr6__pyx_v_s = 0;
      goto __pyx_L22_exit_scope;
      __pyx_L18_error:;
      __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_s); __pyx_8genexpr6__pyx_v_s = 0;
      goto __pyx_L1_error;
      __pyx_L22_exit_scope:;
    } /* exit inner scope */
    __pyx_v_ids = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":579
 *     if first_iteration:
 *         ids = [s.id for s in steps]
 *         finished_statuses = {f'{v}' for v in [buelon.core.step.StepStatus.cancel.value, buelon.core.step.StepStatus.success.value]}             # <<<<<<<<<<<<<<
 *         sql = f'SELECT status FROM steps WHERE id IN ({", ".join("?" * len(ids))})'
 * 
 */
    { /* enter inner scope */
      __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 579, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 579, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_success); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 579, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L25_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 579, __pyx_L25_error);
      __Pyx_GIVEREF(__pyx_t_6);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6)) __PYX_ERR(0, 579, __pyx_L25_error);
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6);
      __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (__pyx_t_8 >= 2) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 579, __pyx_L25_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L25_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_v, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_8genexpr7__pyx_v_v, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L25_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 579, __pyx_L25_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_v); __pyx_8genexpr7__pyx_v_v = 0;
      goto __pyx_L29_exit_scope;
      __pyx_L25_error:;
      __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_v); __pyx_8genexpr7__pyx_v_v = 0;
      goto __pyx_L1_error;
      __pyx_L29_exit_scope:;
    } /* exit inner scope */
    __pyx_v_finished_statuses = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":580
 *         ids = [s.id for s in steps]
 *         finished_statuses = {f'{v}' for v in [buelon.core.step.StepStatus.cancel.value, buelon.core.step.StepStatus.success.value]}
 *         sql = f'SELECT status FROM steps WHERE id IN ({", ".join("?" * len(ids))})'             # <<<<<<<<<<<<<<
 * 
 *         # new
 */
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = 0;
    __pyx_t_10 = 127;
    __Pyx_INCREF(__pyx_kp_u_SELECT_status_FROM_steps_WHERE_i);
    __pyx_t_8 += 38;
    __Pyx_GIVEREF(__pyx_kp_u_SELECT_status_FROM_steps_WHERE_i);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_SELECT_status_FROM_steps_WHERE_i);
    __pyx_t_11 = __Pyx_PyList_GET_SIZE(__pyx_v_ids); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 580, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PySequence_Multiply(__pyx_kp_s__22, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_10;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u__23);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__23);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__23);
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_sql = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "buelon/cython/c_hub.pyx":583
 * 
 *         # new
 *         rows = self.execute_db_query(sql, ids)             # <<<<<<<<<<<<<<
 * 
 *         # with sqlite3.connect(db_path) as conn:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_sql, __pyx_v_ids};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 583, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_v_rows = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "buelon/cython/c_hub.pyx":590
 *         #     rows = cur.fetchall()
 * 
 *         if all([f'{row[0]}' in finished_statuses for row in rows]):             # <<<<<<<<<<<<<<
 *             for s in steps:
 *                 remove_data(s.id)
 */
    { /* enter inner scope */
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 590, __pyx_L33_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (likely(PyList_CheckExact(__pyx_v_rows)) || PyTuple_CheckExact(__pyx_v_rows)) {
        __pyx_t_1 = __pyx_v_rows; __Pyx_INCREF(__pyx_t_1);
        __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L33_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 590, __pyx_L33_error)
      }
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 590, __pyx_L33_error)
              #endif
              if (__pyx_t_8 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 590, __pyx_L33_error)
            #else
            __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L33_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 590, __pyx_L33_error)
              #endif
              if (__pyx_t_8 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 590, __pyx_L33_error)
            #else
            __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L33_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          }
        } else {
          __pyx_t_3 = __pyx_t_9(__pyx_t_1);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 590, __pyx_L33_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_row, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_8genexpr8__pyx_v_row, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L33_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L33_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_t_4, __pyx_v_finished_statuses, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 590, __pyx_L33_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L33_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 590, __pyx_L33_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_row); __pyx_8genexpr8__pyx_v_row = 0;
      goto __pyx_L37_exit_scope;
      __pyx_L33_error:;
      __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_row); __pyx_8genexpr8__pyx_v_row = 0;
      goto __pyx_L1_error;
      __pyx_L37_exit_scope:;
    } /* exit inner scope */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_all, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "buelon/cython/c_hub.pyx":591
 * 
 *         if all([f'{row[0]}' in finished_statuses for row in rows]):
 *             for s in steps:             # <<<<<<<<<<<<<<
 *                 remove_data(s.id)
 * 
 */
      if (likely(PyList_CheckExact(__pyx_v_steps)) || PyTuple_CheckExact(__pyx_v_steps)) {
        __pyx_t_1 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_1);
        __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_steps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 591, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 591, __pyx_L1_error)
              #endif
              if (__pyx_t_8 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 591, __pyx_L1_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 591, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 591, __pyx_L1_error)
              #endif
              if (__pyx_t_8 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 591, __pyx_L1_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 591, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_9(__pyx_t_1);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 591, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "buelon/cython/c_hub.pyx":592
 *         if all([f'{row[0]}' in finished_statuses for row in rows]):
 *             for s in steps:
 *                 remove_data(s.id)             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_remove_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_12 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_3};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 592, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "buelon/cython/c_hub.pyx":591
 * 
 *         if all([f'{row[0]}' in finished_statuses for row in rows]):
 *             for s in steps:             # <<<<<<<<<<<<<<
 *                 remove_data(s.id)
 * 
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "buelon/cython/c_hub.pyx":590
 *         #     rows = cur.fetchall()
 * 
 *         if all([f'{row[0]}' in finished_statuses for row in rows]):             # <<<<<<<<<<<<<<
 *             for s in steps:
 *                 remove_data(s.id)
 */
    }

    /* "buelon/cython/c_hub.pyx":577
 *                 check_to_delete_bucket_files(self, child, already, steps)
 * 
 *     if first_iteration:             # <<<<<<<<<<<<<<
 *         ids = [s.id for s in steps]
 *         finished_statuses = {f'{v}' for v in [buelon.core.step.StepStatus.cancel.value, buelon.core.step.StepStatus.success.value]}
 */
  }

  /* "buelon/cython/c_hub.pyx":550
 * 
 * 
 * def _check_to_delete_bucket_files(             # <<<<<<<<<<<<<<
 *     self: HubServer,
 *     step_id: str,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("buelon.cython.c_hub._check_to_delete_bucket_files", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_first_iteration);
  __Pyx_XDECREF(__pyx_v__step);
  __Pyx_XDECREF(__pyx_v_parent);
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_ids);
  __Pyx_XDECREF(__pyx_v_finished_statuses);
  __Pyx_XDECREF(__pyx_v_sql);
  __Pyx_XDECREF(__pyx_v_rows);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_s);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_v);
  __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_already);
  __Pyx_XDECREF(__pyx_v_steps);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":595
 * 
 * 
 * def _done(self: HubServer, step_id: str):             # <<<<<<<<<<<<<<
 *     _step = get_step(step_id)
 *     sql_update_step = (
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_60_done(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_v__step = NULL;
  PyObject *__pyx_v_sql_update_step = NULL;
  PyObject *__pyx_v_params = NULL;
  PyObject *__pyx_v_sql_update_children = NULL;
  PyObject *__pyx_v_children_params = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_done", 1);

  /* "buelon/cython/c_hub.pyx":596
 * 
 * def _done(self: HubServer, step_id: str):
 *     _step = get_step(step_id)             # <<<<<<<<<<<<<<
 *     sql_update_step = (
 *         f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.success.value}\', epoch = ? WHERE id = ?')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_step_id};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v__step = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":598
 *     _step = get_step(step_id)
 *     sql_update_step = (
 *         f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.success.value}\', epoch = ? WHERE id = ?')             # <<<<<<<<<<<<<<
 *     params = (time.time(), _step.id)
 * 
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;
  __Pyx_INCREF(__pyx_kp_u_UPDATE_steps_SET_status);
  __pyx_t_5 += 27;
  __Pyx_GIVEREF(__pyx_kp_u_UPDATE_steps_SET_status);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_UPDATE_steps_SET_status);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __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_StepStatus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_success); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __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_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_epoch_WHERE_id);
  __pyx_t_5 += 25;
  __Pyx_GIVEREF(__pyx_kp_u_epoch_WHERE_id);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_epoch_WHERE_id);
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_sql_update_step = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":599
 *     sql_update_step = (
 *         f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.success.value}\', epoch = ? WHERE id = ?')
 *     params = (time.time(), _step.id)             # <<<<<<<<<<<<<<
 * 
 *     self.execute_db_query(sql_update_step, params)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_v_params = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":601
 *     params = (time.time(), _step.id)
 * 
 *     self.execute_db_query(sql_update_step, params)             # <<<<<<<<<<<<<<
 * 
 *     if _step.children:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_sql_update_step, __pyx_v_params};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __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;

  /* "buelon/cython/c_hub.pyx":603
 *     self.execute_db_query(sql_update_step, params)
 * 
 *     if _step.children:             # <<<<<<<<<<<<<<
 *         sql_update_children = (
 *             f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.pending.value}\', epoch = ? WHERE id IN ({", ".join("?" * len(_step.children))})')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __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, 603, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {

    /* "buelon/cython/c_hub.pyx":605
 *     if _step.children:
 *         sql_update_children = (
 *             f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.pending.value}\', epoch = ? WHERE id IN ({", ".join("?" * len(_step.children))})')             # <<<<<<<<<<<<<<
 *         children_params = (time.time(), *_step.children)
 * 
 */
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_UPDATE_steps_SET_status);
    __pyx_t_5 += 27;
    __Pyx_GIVEREF(__pyx_kp_u_UPDATE_steps_SET_status);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_UPDATE_steps_SET_status);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_core); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 605, __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_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 605, __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_pending); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u_epoch_WHERE_id_IN);
    __pyx_t_5 += 26;
    __Pyx_GIVEREF(__pyx_kp_u_epoch_WHERE_id_IN);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_epoch_WHERE_id_IN);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PySequence_Multiply(__pyx_kp_s__22, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__23);
    __pyx_t_5 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__23);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__23);
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_sql_update_children = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":606
 *         sql_update_children = (
 *             f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.pending.value}\', epoch = ? WHERE id IN ({", ".join("?" * len(_step.children))})')
 *         children_params = (time.time(), *_step.children)             # <<<<<<<<<<<<<<
 * 
 *         self.execute_db_query(sql_update_children, children_params)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_3 = __pyx_t_9;
    __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_PyList_Extend(__pyx_t_3, __pyx_t_9) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    {
      PyObject *__pyx_temp = PyList_AsTuple(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3);
      __pyx_t_3 = __pyx_temp; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_v_children_params = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":608
 *         children_params = (time.time(), *_step.children)
 * 
 *         self.execute_db_query(sql_update_children, children_params)             # <<<<<<<<<<<<<<
 * 
 *     # check_to_delete_bucket_files(self, step_id)
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_sql_update_children, __pyx_v_children_params};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":603
 *     self.execute_db_query(sql_update_step, params)
 * 
 *     if _step.children:             # <<<<<<<<<<<<<<
 *         sql_update_children = (
 *             f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.pending.value}\', epoch = ? WHERE id IN ({", ".join("?" * len(_step.children))})')
 */
  }

  /* "buelon/cython/c_hub.pyx":595
 * 
 * 
 * def _done(self: HubServer, step_id: str):             # <<<<<<<<<<<<<<
 *     _step = get_step(step_id)
 *     sql_update_step = (
 */

  /* 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_9);
  __Pyx_AddTraceback("buelon.cython.c_hub._done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__step);
  __Pyx_XDECREF(__pyx_v_sql_update_step);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XDECREF(__pyx_v_sql_update_children);
  __Pyx_XDECREF(__pyx_v_children_params);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":629
 * 
 * 
 * def _pending(self: HubServer, step_id: str):             # <<<<<<<<<<<<<<
 *     sql_update_step = (
 *         f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.pending.value}\', epoch = ? WHERE id = ?')
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_62_pending(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_v_sql_update_step = NULL;
  PyObject *__pyx_v_params = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_pending", 1);

  /* "buelon/cython/c_hub.pyx":631
 * def _pending(self: HubServer, step_id: str):
 *     sql_update_step = (
 *         f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.pending.value}\', epoch = ? WHERE id = ?')             # <<<<<<<<<<<<<<
 *     params = (time.time(), step_id)
 *     self.execute_db_query(sql_update_step, params)
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_UPDATE_steps_SET_status);
  __pyx_t_2 += 27;
  __Pyx_GIVEREF(__pyx_kp_u_UPDATE_steps_SET_status);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_UPDATE_steps_SET_status);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_buelon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_core); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pending); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_epoch_WHERE_id);
  __pyx_t_2 += 25;
  __Pyx_GIVEREF(__pyx_kp_u_epoch_WHERE_id);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_epoch_WHERE_id);
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_sql_update_step = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":632
 *     sql_update_step = (
 *         f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.pending.value}\', epoch = ? WHERE id = ?')
 *     params = (time.time(), step_id)             # <<<<<<<<<<<<<<
 *     self.execute_db_query(sql_update_step, params)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_step_id);
  __Pyx_GIVEREF(__pyx_v_step_id);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_step_id)) __PYX_ERR(0, 632, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_v_params = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "buelon/cython/c_hub.pyx":633
 *         f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.pending.value}\', epoch = ? WHERE id = ?')
 *     params = (time.time(), step_id)
 *     self.execute_db_query(sql_update_step, params)             # <<<<<<<<<<<<<<
 * 
 *     # with sqlite3.connect(db_path) as conn:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_sql_update_step, __pyx_v_params};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "buelon/cython/c_hub.pyx":629
 * 
 * 
 * def _pending(self: HubServer, step_id: str):             # <<<<<<<<<<<<<<
 *     sql_update_step = (
 *         f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.pending.value}\', epoch = ? WHERE id = ?')
 */

  /* 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("buelon.cython.c_hub._pending", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sql_update_step);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":640
 * 
 * 
 * def _cancel(             # <<<<<<<<<<<<<<
 *     self: HubServer,
 *     step_id: str,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_65_cancel(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_65_cancel = {"_cancel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_65_cancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_65_cancel(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_step_id = 0;
  PyObject *__pyx_v_already = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_cancel (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_step_id,&__pyx_n_s_already,0};

    /* "buelon/cython/c_hub.pyx":643
 *     self: HubServer,
 *     step_id: str,
 *     already: set | None = None             # <<<<<<<<<<<<<<
 * ) -> None:
 *     first_iteration = already is None
 */
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_id)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_cancel", 0, 2, 3, 1); __PYX_ERR(0, 640, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_already);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_cancel") < 0)) __PYX_ERR(0, 640, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_step_id = ((PyObject*)values[1]);
    __pyx_v_already = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_cancel", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 640, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub._cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_id), (&PyString_Type), 0, "step_id", 1))) __PYX_ERR(0, 642, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_64_cancel(__pyx_self, __pyx_v_self, __pyx_v_step_id, __pyx_v_already);

  /* "buelon/cython/c_hub.pyx":640
 * 
 * 
 * def _cancel(             # <<<<<<<<<<<<<<
 *     self: HubServer,
 *     step_id: str,
 */

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_64_cancel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_already) {
  PyObject *__pyx_v_first_iteration = NULL;
  PyObject *__pyx_v__step = NULL;
  PyObject *__pyx_v_sql_update_step = NULL;
  PyObject *__pyx_v_params = NULL;
  PyObject *__pyx_v_parent = NULL;
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_cancel", 0);
  __Pyx_INCREF(__pyx_v_already);

  /* "buelon/cython/c_hub.pyx":645
 *     already: set | None = None
 * ) -> None:
 *     first_iteration = already is None             # <<<<<<<<<<<<<<
 *     _step = get_step(step_id)
 *     already = set() if first_iteration else already
 */
  __pyx_t_1 = (__pyx_v_already == Py_None);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_first_iteration = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":646
 * ) -> None:
 *     first_iteration = already is None
 *     _step = get_step(step_id)             # <<<<<<<<<<<<<<
 *     already = set() if first_iteration else already
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_step_id};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v__step = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":647
 *     first_iteration = already is None
 *     _step = get_step(step_id)
 *     already = set() if first_iteration else already             # <<<<<<<<<<<<<<
 * 
 *     sql_update_step = f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.cancel.value}\', epoch = ? WHERE id = ?'
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_first_iteration); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 647, __pyx_L1_error)
  if (__pyx_t_1) {
    __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_already);
    __pyx_t_2 = __pyx_v_already;
  }
  __Pyx_DECREF_SET(__pyx_v_already, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":649
 *     already = set() if first_iteration else already
 * 
 *     sql_update_step = f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.cancel.value}\', epoch = ? WHERE id = ?'             # <<<<<<<<<<<<<<
 *     params = (time.time(), _step.id)
 *     self.execute_db_query(sql_update_step, params)
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = 0;
  __pyx_t_7 = 127;
  __Pyx_INCREF(__pyx_kp_u_UPDATE_steps_SET_status);
  __pyx_t_6 += 27;
  __Pyx_GIVEREF(__pyx_kp_u_UPDATE_steps_SET_status);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_UPDATE_steps_SET_status);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u_epoch_WHERE_id);
  __pyx_t_6 += 25;
  __Pyx_GIVEREF(__pyx_kp_u_epoch_WHERE_id);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_epoch_WHERE_id);
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_sql_update_step = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":650
 * 
 *     sql_update_step = f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.cancel.value}\', epoch = ? WHERE id = ?'
 *     params = (time.time(), _step.id)             # <<<<<<<<<<<<<<
 *     self.execute_db_query(sql_update_step, params)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 650, __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_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 650, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_v_params = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":651
 *     sql_update_step = f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.cancel.value}\', epoch = ? WHERE id = ?'
 *     params = (time.time(), _step.id)
 *     self.execute_db_query(sql_update_step, params)             # <<<<<<<<<<<<<<
 * 
 *     # with sqlite3.connect(db_path) as conn:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_sql_update_step, __pyx_v_params};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":658
 *     #     conn.commit()
 * 
 *     if _step.parents:             # <<<<<<<<<<<<<<
 *         for parent in _step.parents:
 *             if parent not in already:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_parents); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":659
 * 
 *     if _step.parents:
 *         for parent in _step.parents:             # <<<<<<<<<<<<<<
 *             if parent not in already:
 *                 already.add(parent)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_parents); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    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_6 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 659, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 659, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 659, __pyx_L1_error)
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 659, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 659, __pyx_L1_error)
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_8(__pyx_t_4);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 659, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_parent, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "buelon/cython/c_hub.pyx":660
 *     if _step.parents:
 *         for parent in _step.parents:
 *             if parent not in already:             # <<<<<<<<<<<<<<
 *                 already.add(parent)
 *                 _cancel(self, parent, already)
 */
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_parent, __pyx_v_already, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 660, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "buelon/cython/c_hub.pyx":661
 *         for parent in _step.parents:
 *             if parent not in already:
 *                 already.add(parent)             # <<<<<<<<<<<<<<
 *                 _cancel(self, parent, already)
 * 
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_already, __pyx_n_s_add); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_parent};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __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;

        /* "buelon/cython/c_hub.pyx":662
 *             if parent not in already:
 *                 already.add(parent)
 *                 _cancel(self, parent, already)             # <<<<<<<<<<<<<<
 * 
 *     if _step.children:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_cancel_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (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);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_v_self, __pyx_v_parent, __pyx_v_already};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __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;

        /* "buelon/cython/c_hub.pyx":660
 *     if _step.parents:
 *         for parent in _step.parents:
 *             if parent not in already:             # <<<<<<<<<<<<<<
 *                 already.add(parent)
 *                 _cancel(self, parent, already)
 */
      }

      /* "buelon/cython/c_hub.pyx":659
 * 
 *     if _step.parents:
 *         for parent in _step.parents:             # <<<<<<<<<<<<<<
 *             if parent not in already:
 *                 already.add(parent)
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":658
 *     #     conn.commit()
 * 
 *     if _step.parents:             # <<<<<<<<<<<<<<
 *         for parent in _step.parents:
 *             if parent not in already:
 */
  }

  /* "buelon/cython/c_hub.pyx":664
 *                 _cancel(self, parent, already)
 * 
 *     if _step.children:             # <<<<<<<<<<<<<<
 *         for child in _step.children:
 *             if child not in already:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":665
 * 
 *     if _step.children:
 *         for child in _step.children:             # <<<<<<<<<<<<<<
 *             if child not in already:
 *                 already.add(child)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_6 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 665, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 665, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 665, __pyx_L1_error)
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 665, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 665, __pyx_L1_error)
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_8(__pyx_t_2);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 665, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "buelon/cython/c_hub.pyx":666
 *     if _step.children:
 *         for child in _step.children:
 *             if child not in already:             # <<<<<<<<<<<<<<
 *                 already.add(child)
 *                 _cancel(self, child, already)
 */
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_child, __pyx_v_already, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 666, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "buelon/cython/c_hub.pyx":667
 *         for child in _step.children:
 *             if child not in already:
 *                 already.add(child)             # <<<<<<<<<<<<<<
 *                 _cancel(self, child, already)
 * 
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_already, __pyx_n_s_add); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_child};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __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;

        /* "buelon/cython/c_hub.pyx":668
 *             if child not in already:
 *                 already.add(child)
 *                 _cancel(self, child, already)             # <<<<<<<<<<<<<<
 * 
 *     # if first_iteration:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_cancel_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (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);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_v_self, __pyx_v_child, __pyx_v_already};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __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;

        /* "buelon/cython/c_hub.pyx":666
 *     if _step.children:
 *         for child in _step.children:
 *             if child not in already:             # <<<<<<<<<<<<<<
 *                 already.add(child)
 *                 _cancel(self, child, already)
 */
      }

      /* "buelon/cython/c_hub.pyx":665
 * 
 *     if _step.children:
 *         for child in _step.children:             # <<<<<<<<<<<<<<
 *             if child not in already:
 *                 already.add(child)
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "buelon/cython/c_hub.pyx":664
 *                 _cancel(self, parent, already)
 * 
 *     if _step.children:             # <<<<<<<<<<<<<<
 *         for child in _step.children:
 *             if child not in already:
 */
  }

  /* "buelon/cython/c_hub.pyx":640
 * 
 * 
 * def _cancel(             # <<<<<<<<<<<<<<
 *     self: HubServer,
 *     step_id: str,
 */

  /* 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_9);
  __Pyx_AddTraceback("buelon.cython.c_hub._cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_first_iteration);
  __Pyx_XDECREF(__pyx_v__step);
  __Pyx_XDECREF(__pyx_v_sql_update_step);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XDECREF(__pyx_v_parent);
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_already);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":674
 * 
 * 
 * def _reset(self: HubServer, step_id: str, already=None):             # <<<<<<<<<<<<<<
 *     _step = get_step(step_id)
 *     already = set() if not already else already
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_67_reset(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_67_reset = {"_reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_67_reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_67_reset(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_step_id = 0;
  PyObject *__pyx_v_already = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_reset (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_step_id,&__pyx_n_s_already,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_id)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_reset", 0, 2, 3, 1); __PYX_ERR(0, 674, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_already);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_reset") < 0)) __PYX_ERR(0, 674, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_step_id = ((PyObject*)values[1]);
    __pyx_v_already = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_reset", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 674, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub._reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_id), (&PyString_Type), 0, "step_id", 1))) __PYX_ERR(0, 674, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_66_reset(__pyx_self, __pyx_v_self, __pyx_v_step_id, __pyx_v_already);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_66_reset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_already) {
  PyObject *__pyx_v__step = NULL;
  PyObject *__pyx_v_status = NULL;
  PyObject *__pyx_v_sql_update_step = NULL;
  PyObject *__pyx_v_params = NULL;
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_v_parent = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_UCS4 __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_reset", 0);
  __Pyx_INCREF(__pyx_v_already);

  /* "buelon/cython/c_hub.pyx":675
 * 
 * def _reset(self: HubServer, step_id: str, already=None):
 *     _step = get_step(step_id)             # <<<<<<<<<<<<<<
 *     already = set() if not already else already
 *     # status = buelon.core.step.StepStatus.pending.value if _step.parents else buelon.core.step.StepStatus.queued.value
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_step_id};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v__step = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":676
 * def _reset(self: HubServer, step_id: str, already=None):
 *     _step = get_step(step_id)
 *     already = set() if not already else already             # <<<<<<<<<<<<<<
 *     # status = buelon.core.step.StepStatus.pending.value if _step.parents else buelon.core.step.StepStatus.queued.value
 *     status = buelon.core.step.StepStatus.queued.value if _step.parents else buelon.core.step.StepStatus.pending.value
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_already); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 676, __pyx_L1_error)
  __pyx_t_6 = (!__pyx_t_5);
  if (__pyx_t_6) {
    __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_already);
    __pyx_t_1 = __pyx_v_already;
  }
  __Pyx_DECREF_SET(__pyx_v_already, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":678
 *     already = set() if not already else already
 *     # status = buelon.core.step.StepStatus.pending.value if _step.parents else buelon.core.step.StepStatus.queued.value
 *     status = buelon.core.step.StepStatus.queued.value if _step.parents else buelon.core.step.StepStatus.pending.value             # <<<<<<<<<<<<<<
 *     sql_update_step = f'UPDATE steps SET status = \'{status}\', epoch = ? WHERE id = ?'
 *     params = (time.time(), _step.id)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_parents); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_6) {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __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_StepStatus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_queued); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __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_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_core); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __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_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __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_pending); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_v_status = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":679
 *     # status = buelon.core.step.StepStatus.pending.value if _step.parents else buelon.core.step.StepStatus.queued.value
 *     status = buelon.core.step.StepStatus.queued.value if _step.parents else buelon.core.step.StepStatus.pending.value
 *     sql_update_step = f'UPDATE steps SET status = \'{status}\', epoch = ? WHERE id = ?'             # <<<<<<<<<<<<<<
 *     params = (time.time(), _step.id)
 * 
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = 0;
  __pyx_t_8 = 127;
  __Pyx_INCREF(__pyx_kp_u_UPDATE_steps_SET_status);
  __pyx_t_7 += 27;
  __Pyx_GIVEREF(__pyx_kp_u_UPDATE_steps_SET_status);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_UPDATE_steps_SET_status);
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_8;
  __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_epoch_WHERE_id);
  __pyx_t_7 += 25;
  __Pyx_GIVEREF(__pyx_kp_u_epoch_WHERE_id);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_epoch_WHERE_id);
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_sql_update_step = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":680
 *     status = buelon.core.step.StepStatus.queued.value if _step.parents else buelon.core.step.StepStatus.pending.value
 *     sql_update_step = f'UPDATE steps SET status = \'{status}\', epoch = ? WHERE id = ?'
 *     params = (time.time(), _step.id)             # <<<<<<<<<<<<<<
 * 
 *     self.execute_db_query(sql_update_step, params)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_v_params = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":682
 *     params = (time.time(), _step.id)
 * 
 *     self.execute_db_query(sql_update_step, params)             # <<<<<<<<<<<<<<
 * 
 *     # with sqlite3.connect(db_path) as conn:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_sql_update_step, __pyx_v_params};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":689
 *     #     conn.commit()
 * 
 *     if _step.children:             # <<<<<<<<<<<<<<
 *         for child in _step.children:
 *             if child not in already:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "buelon/cython/c_hub.pyx":690
 * 
 *     if _step.children:
 *         for child in _step.children:             # <<<<<<<<<<<<<<
 *             if child not in already:
 *                 already.add(child)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    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_7 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 690, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 690, __pyx_L1_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 690, __pyx_L1_error)
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 690, __pyx_L1_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 690, __pyx_L1_error)
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_9(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 690, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "buelon/cython/c_hub.pyx":691
 *     if _step.children:
 *         for child in _step.children:
 *             if child not in already:             # <<<<<<<<<<<<<<
 *                 already.add(child)
 *                 _reset(self, child, already)
 */
      __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_child, __pyx_v_already, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 691, __pyx_L1_error)
      if (__pyx_t_6) {

        /* "buelon/cython/c_hub.pyx":692
 *         for child in _step.children:
 *             if child not in already:
 *                 already.add(child)             # <<<<<<<<<<<<<<
 *                 _reset(self, child, already)
 * 
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_already, __pyx_n_s_add); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_child};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __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;

        /* "buelon/cython/c_hub.pyx":693
 *             if child not in already:
 *                 already.add(child)
 *                 _reset(self, child, already)             # <<<<<<<<<<<<<<
 * 
 *     if _step.parents:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_10, __pyx_v_self, __pyx_v_child, __pyx_v_already};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __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;

        /* "buelon/cython/c_hub.pyx":691
 *     if _step.children:
 *         for child in _step.children:
 *             if child not in already:             # <<<<<<<<<<<<<<
 *                 already.add(child)
 *                 _reset(self, child, already)
 */
      }

      /* "buelon/cython/c_hub.pyx":690
 * 
 *     if _step.children:
 *         for child in _step.children:             # <<<<<<<<<<<<<<
 *             if child not in already:
 *                 already.add(child)
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":689
 *     #     conn.commit()
 * 
 *     if _step.children:             # <<<<<<<<<<<<<<
 *         for child in _step.children:
 *             if child not in already:
 */
  }

  /* "buelon/cython/c_hub.pyx":695
 *                 _reset(self, child, already)
 * 
 *     if _step.parents:             # <<<<<<<<<<<<<<
 *         for parent in _step.parents:
 *             if parent not in already:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_parents); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "buelon/cython/c_hub.pyx":696
 * 
 *     if _step.parents:
 *         for parent in _step.parents:             # <<<<<<<<<<<<<<
 *             if parent not in already:
 *                 already.add(parent)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_parents); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_7 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 696, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 696, __pyx_L1_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 696, __pyx_L1_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 696, __pyx_L1_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 696, __pyx_L1_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_9(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 696, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_parent, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "buelon/cython/c_hub.pyx":697
 *     if _step.parents:
 *         for parent in _step.parents:
 *             if parent not in already:             # <<<<<<<<<<<<<<
 *                 already.add(parent)
 *                 _reset(self, parent, already)
 */
      __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_parent, __pyx_v_already, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 697, __pyx_L1_error)
      if (__pyx_t_6) {

        /* "buelon/cython/c_hub.pyx":698
 *         for parent in _step.parents:
 *             if parent not in already:
 *                 already.add(parent)             # <<<<<<<<<<<<<<
 *                 _reset(self, parent, already)
 * 
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_already, __pyx_n_s_add); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_parent};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "buelon/cython/c_hub.pyx":699
 *             if parent not in already:
 *                 already.add(parent)
 *                 _reset(self, parent, already)             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_10 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_10, __pyx_v_self, __pyx_v_parent, __pyx_v_already};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "buelon/cython/c_hub.pyx":697
 *     if _step.parents:
 *         for parent in _step.parents:
 *             if parent not in already:             # <<<<<<<<<<<<<<
 *                 already.add(parent)
 *                 _reset(self, parent, already)
 */
      }

      /* "buelon/cython/c_hub.pyx":696
 * 
 *     if _step.parents:
 *         for parent in _step.parents:             # <<<<<<<<<<<<<<
 *             if parent not in already:
 *                 already.add(parent)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":695
 *                 _reset(self, child, already)
 * 
 *     if _step.parents:             # <<<<<<<<<<<<<<
 *         for parent in _step.parents:
 *             if parent not in already:
 */
  }

  /* "buelon/cython/c_hub.pyx":674
 * 
 * 
 * def _reset(self: HubServer, step_id: str, already=None):             # <<<<<<<<<<<<<<
 *     _step = get_step(step_id)
 *     already = set() if not already else already
 */

  /* 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_10);
  __Pyx_AddTraceback("buelon.cython.c_hub._reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__step);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XDECREF(__pyx_v_sql_update_step);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_parent);
  __Pyx_XDECREF(__pyx_v_already);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":702
 * 
 * 
 * def _error(self: HubServer, step_id: str, msg: str, trace: str):             # <<<<<<<<<<<<<<
 *     _step = get_step(step_id)
 *     sql_update_step = (f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.error.value}\', epoch = ?, msg = ?, trace = ? WHERE id = ?')
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_69_error(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_69_error = {"_error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_69_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_69_error(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_step_id = 0;
  PyObject *__pyx_v_msg = 0;
  PyObject *__pyx_v_trace = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_error (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_step_id,&__pyx_n_s_msg,&__pyx_n_s_trace,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_id)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_error", 1, 4, 4, 1); __PYX_ERR(0, 702, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_msg)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_error", 1, 4, 4, 2); __PYX_ERR(0, 702, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_trace)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_error", 1, 4, 4, 3); __PYX_ERR(0, 702, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_error") < 0)) __PYX_ERR(0, 702, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_step_id = ((PyObject*)values[1]);
    __pyx_v_msg = ((PyObject*)values[2]);
    __pyx_v_trace = ((PyObject*)values[3]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_error", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 702, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub._error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_id), (&PyString_Type), 0, "step_id", 1))) __PYX_ERR(0, 702, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_msg), (&PyString_Type), 0, "msg", 1))) __PYX_ERR(0, 702, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_trace), (&PyString_Type), 0, "trace", 1))) __PYX_ERR(0, 702, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_68_error(__pyx_self, __pyx_v_self, __pyx_v_step_id, __pyx_v_msg, __pyx_v_trace);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_68_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_msg, PyObject *__pyx_v_trace) {
  PyObject *__pyx_v__step = NULL;
  PyObject *__pyx_v_sql_update_step = 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;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_error", 1);

  /* "buelon/cython/c_hub.pyx":703
 * 
 * def _error(self: HubServer, step_id: str, msg: str, trace: str):
 *     _step = get_step(step_id)             # <<<<<<<<<<<<<<
 *     sql_update_step = (f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.error.value}\', epoch = ?, msg = ?, trace = ? WHERE id = ?')
 *     params = (time.time(), msg, trace, _step.id)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_step_id};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v__step = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":704
 * def _error(self: HubServer, step_id: str, msg: str, trace: str):
 *     _step = get_step(step_id)
 *     sql_update_step = (f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.error.value}\', epoch = ?, msg = ?, trace = ? WHERE id = ?')             # <<<<<<<<<<<<<<
 *     params = (time.time(), msg, trace, _step.id)
 * 
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;
  __Pyx_INCREF(__pyx_kp_u_UPDATE_steps_SET_status);
  __pyx_t_5 += 27;
  __Pyx_GIVEREF(__pyx_kp_u_UPDATE_steps_SET_status);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_UPDATE_steps_SET_status);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __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_StepStatus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __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_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_epoch_msg_trace_WHERE_id);
  __pyx_t_5 += 45;
  __Pyx_GIVEREF(__pyx_kp_u_epoch_msg_trace_WHERE_id);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_epoch_msg_trace_WHERE_id);
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_sql_update_step = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":705
 *     _step = get_step(step_id)
 *     sql_update_step = (f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.error.value}\', epoch = ?, msg = ?, trace = ? WHERE id = ?')
 *     params = (time.time(), msg, trace, _step.id)             # <<<<<<<<<<<<<<
 * 
 *     self.execute_db_query(sql_update_step, params)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_msg);
  __Pyx_GIVEREF(__pyx_v_msg);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_msg)) __PYX_ERR(0, 705, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_trace);
  __Pyx_GIVEREF(__pyx_v_trace);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_trace)) __PYX_ERR(0, 705, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_v_params = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":707
 *     params = (time.time(), msg, trace, _step.id)
 * 
 *     self.execute_db_query(sql_update_step, params)             # <<<<<<<<<<<<<<
 * 
 *     # with sqlite3.connect(db_path) as conn:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_sql_update_step, __pyx_v_params};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __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;

  /* "buelon/cython/c_hub.pyx":702
 * 
 * 
 * def _error(self: HubServer, step_id: str, msg: str, trace: str):             # <<<<<<<<<<<<<<
 *     _step = get_step(step_id)
 *     sql_update_step = (f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.error.value}\', epoch = ?, msg = ?, trace = ? WHERE id = ?')
 */

  /* 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("buelon.cython.c_hub._error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__step);
  __Pyx_XDECREF(__pyx_v_sql_update_step);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":715
 * 
 * 
 * def _fetch_errors(self: HubServer, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *     if not isinstance(count, int):
 *         raise ValueError('count must be an integer')
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_71_fetch_errors(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_71_fetch_errors = {"_fetch_errors", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_71_fetch_errors, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_71_fetch_errors(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_count = 0;
  PyObject *__pyx_v_exclude = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_fetch_errors (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_count,&__pyx_n_s_exclude,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 715, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_count)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 715, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_fetch_errors", 0, 2, 3, 1); __PYX_ERR(0, 715, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exclude);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 715, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_fetch_errors") < 0)) __PYX_ERR(0, 715, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_count = ((PyObject*)values[1]);
    __pyx_v_exclude = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_fetch_errors", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 715, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub._fetch_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_count), (&PyInt_Type), 0, "count", 1))) __PYX_ERR(0, 715, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_70_fetch_errors(__pyx_self, __pyx_v_self, __pyx_v_count, __pyx_v_exclude);

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

/* "buelon/cython/c_hub.pyx":727
 * 
 *     allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 *     def clean_query_string(query_string: str) -> str:             # <<<<<<<<<<<<<<
 *         return ''.join(c for c in query_string if c in allow_chars)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_13_fetch_errors_1clean_query_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_13_fetch_errors_1clean_query_string = {"clean_query_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_13_fetch_errors_1clean_query_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_13_fetch_errors_1clean_query_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_query_string = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clean_query_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query_string,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query_string)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clean_query_string") < 0)) __PYX_ERR(0, 727, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_query_string = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("clean_query_string", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 727, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub._fetch_errors.clean_query_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query_string), (&PyString_Type), 0, "query_string", 1))) __PYX_ERR(0, 727, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_clean_query_string(__pyx_self, __pyx_v_query_string);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_13_fetch_errors_18clean_query_string_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":728
 *     allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 *     def clean_query_string(query_string: str) -> str:
 *         return ''.join(c for c in query_string if c in allow_chars)             # <<<<<<<<<<<<<<
 * 
 *     exclude_query = ''
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_18clean_query_string_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 728, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_13_fetch_errors_18clean_query_string_2generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_fetch_errors_locals_clean_query, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 728, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub._fetch_errors.clean_query_string.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_6buelon_6cython_5c_hub_13_fetch_errors_18clean_query_string_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *(*__pyx_t_2)(PyObject *);
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_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, 728, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 728, __pyx_L1_error) }
  __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error)
  for (;;) {
    {
      __pyx_t_3 = __pyx_t_2(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 728, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_allow_chars)) { __Pyx_RaiseClosureNameError("allow_chars"); __PYX_ERR(0, 728, __pyx_L1_error) }
    __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_c, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_allow_chars, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 728, __pyx_L1_error)
    if (__pyx_t_4) {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_c);
      __pyx_r = __pyx_cur_scope->__pyx_v_c;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 728, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":727
 * 
 *     allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 *     def clean_query_string(query_string: str) -> str:             # <<<<<<<<<<<<<<
 *         return ''.join(c for c in query_string if c in allow_chars)
 * 
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_clean_query_string(PyObject *__pyx_self, PyObject *__pyx_v_query_string) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *__pyx_cur_scope;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *__pyx_outer_scope;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_13_fetch_errors_18clean_query_string_2generator2 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clean_query_string", 1);
  __pyx_outer_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "buelon/cython/c_hub.pyx":728
 *     allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 *     def clean_query_string(query_string: str) -> str:
 *         return ''.join(c for c in query_string if c in allow_chars)             # <<<<<<<<<<<<<<
 * 
 *     exclude_query = ''
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_18clean_query_string_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_query_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 728, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":727
 * 
 *     allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 *     def clean_query_string(query_string: str) -> str:             # <<<<<<<<<<<<<<
 *         return ''.join(c for c in query_string if c in allow_chars)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("buelon.cython.c_hub._fetch_errors.clean_query_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_13_fetch_errors_18clean_query_string_2generator2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_13_fetch_errors_4generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":723
 * 
 *     if isinstance(exclude, list):
 *         if not all(isinstance(x, str) for x in exclude):             # <<<<<<<<<<<<<<
 *             raise ValueError('exclude must be a list of strings')
 * 
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_2genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 723, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_13_fetch_errors_4generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_fetch_errors_locals_genexpr, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub._fetch_errors.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_6buelon_6cython_5c_hub_13_fetch_errors_4generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 723, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 723, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 723, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 723, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 723, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 723, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 723, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 723, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 723, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = PyString_Check(__pyx_cur_scope->__pyx_v_x); 
    __pyx_t_6 = (!__pyx_t_5);
    if (__pyx_t_6) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_13_fetch_errors_7generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":736
 *         exclude_query = (' AND not ('
 *                          + ' OR '.join(
 *                                 f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''             # <<<<<<<<<<<<<<
 *                                 for ex in exclude)
 *                          + ')')
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_5genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 736, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_13_fetch_errors_7generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_fetch_errors_locals_genexpr, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub._fetch_errors.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_6buelon_6cython_5c_hub_13_fetch_errors_7generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 736, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":737
 *                          + ' OR '.join(
 *                                 f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''
 *                                 for ex in exclude)             # <<<<<<<<<<<<<<
 *                          + ')')
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 737, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 737, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 737, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 737, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 737, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 737, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ex);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ex, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":736
 *         exclude_query = (' AND not ('
 *                          + ' OR '.join(
 *                                 f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''             # <<<<<<<<<<<<<<
 *                                 for ex in exclude)
 *                          + ')')
 */
    __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_lower_msg_like);
    __pyx_t_5 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_lower_msg_like);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_lower_msg_like);
    if (!(likely(PyString_CheckExact(__pyx_cur_scope->__pyx_v_ex))||((__pyx_cur_scope->__pyx_v_ex) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_cur_scope->__pyx_v_ex))) __PYX_ERR(0, 736, __pyx_L1_error)
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_clean_query_string)) { __Pyx_RaiseClosureNameError("clean_query_string"); __PYX_ERR(0, 736, __pyx_L1_error) }
    __pyx_t_7 = __pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_clean_query_string(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_clean_query_string, ((PyObject*)__pyx_cur_scope->__pyx_v_ex)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_kp_u_OR_lower_trace_like);
    __pyx_t_5 += 26;
    __Pyx_GIVEREF(__pyx_kp_u_OR_lower_trace_like);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_OR_lower_trace_like);
    if (!(likely(PyString_CheckExact(__pyx_cur_scope->__pyx_v_ex))||((__pyx_cur_scope->__pyx_v_ex) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_cur_scope->__pyx_v_ex))) __PYX_ERR(0, 736, __pyx_L1_error)
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_clean_query_string)) { __Pyx_RaiseClosureNameError("clean_query_string"); __PYX_ERR(0, 736, __pyx_L1_error) }
    __pyx_t_8 = __pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_clean_query_string(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_clean_query_string, ((PyObject*)__pyx_cur_scope->__pyx_v_ex)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__24);
    __pyx_t_5 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__24);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u__24);
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 736, __pyx_L1_error)

    /* "buelon/cython/c_hub.pyx":737
 *                          + ' OR '.join(
 *                                 f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''
 *                                 for ex in exclude)             # <<<<<<<<<<<<<<
 *                          + ')')
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "buelon/cython/c_hub.pyx":736
 *         exclude_query = (' AND not ('
 *                          + ' OR '.join(
 *                                 f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''             # <<<<<<<<<<<<<<
 *                                 for ex in exclude)
 *                          + ')')
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":715
 * 
 * 
 * def _fetch_errors(self: HubServer, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *     if not isinstance(count, int):
 *         raise ValueError('count must be an integer')
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_70_fetch_errors(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_count, PyObject *__pyx_v_exclude) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *__pyx_cur_scope;
  PyObject *__pyx_v_exclude_query = NULL;
  PyObject *__pyx_v_sql = NULL;
  PyObject *__pyx_v_params = NULL;
  PyObject *__pyx_v_error_size_query = NULL;
  PyObject *__pyx_v_table = NULL;
  PyObject *__pyx_v_error_size = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_13_fetch_errors_4generator1 = 0;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_13_fetch_errors_7generator3 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_fetch_errors", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 715, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "buelon/cython/c_hub.pyx":716
 * 
 * def _fetch_errors(self: HubServer, count: int, exclude: list[str] | str | None = None) -> dict:
 *     if not isinstance(count, int):             # <<<<<<<<<<<<<<
 *         raise ValueError('count must be an integer')
 * 
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_count); 
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "buelon/cython/c_hub.pyx":717
 * def _fetch_errors(self: HubServer, count: int, exclude: list[str] | str | None = None) -> dict:
 *     if not isinstance(count, int):
 *         raise ValueError('count must be an integer')             # <<<<<<<<<<<<<<
 * 
 *     if not isinstance(exclude, (type(None), str, list)):
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 717, __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, 717, __pyx_L1_error)

    /* "buelon/cython/c_hub.pyx":716
 * 
 * def _fetch_errors(self: HubServer, count: int, exclude: list[str] | str | None = None) -> dict:
 *     if not isinstance(count, int):             # <<<<<<<<<<<<<<
 *         raise ValueError('count must be an integer')
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":719
 *         raise ValueError('count must be an integer')
 * 
 *     if not isinstance(exclude, (type(None), str, list)):             # <<<<<<<<<<<<<<
 *         raise ValueError('exclude must be a string or a list')
 * 
 */
  __Pyx_INCREF(((PyObject *)Py_TYPE(Py_None)));
  __pyx_t_3 = ((PyObject *)Py_TYPE(Py_None));
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_exclude, __pyx_t_3); 
  if (!__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = PyString_Check(__pyx_v_exclude); 
  if (!__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = PyList_Check(__pyx_v_exclude); 
  __pyx_t_2 = __pyx_t_1;
  __pyx_L5_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (!__pyx_t_2);
  if (unlikely(__pyx_t_1)) {

    /* "buelon/cython/c_hub.pyx":720
 * 
 *     if not isinstance(exclude, (type(None), str, list)):
 *         raise ValueError('exclude must be a string or a list')             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(exclude, list):
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 720, __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, 720, __pyx_L1_error)

    /* "buelon/cython/c_hub.pyx":719
 *         raise ValueError('count must be an integer')
 * 
 *     if not isinstance(exclude, (type(None), str, list)):             # <<<<<<<<<<<<<<
 *         raise ValueError('exclude must be a string or a list')
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":722
 *         raise ValueError('exclude must be a string or a list')
 * 
 *     if isinstance(exclude, list):             # <<<<<<<<<<<<<<
 *         if not all(isinstance(x, str) for x in exclude):
 *             raise ValueError('exclude must be a list of strings')
 */
  __pyx_t_1 = PyList_Check(__pyx_v_exclude); 
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":723
 * 
 *     if isinstance(exclude, list):
 *         if not all(isinstance(x, str) for x in exclude):             # <<<<<<<<<<<<<<
 *             raise ValueError('exclude must be a list of strings')
 * 
 */
    __pyx_t_3 = __pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_2genexpr(NULL, __pyx_v_exclude); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 723, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = (!__pyx_t_1);
    if (unlikely(__pyx_t_2)) {

      /* "buelon/cython/c_hub.pyx":724
 *     if isinstance(exclude, list):
 *         if not all(isinstance(x, str) for x in exclude):
 *             raise ValueError('exclude must be a list of strings')             # <<<<<<<<<<<<<<
 * 
 *     allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __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, 724, __pyx_L1_error)

      /* "buelon/cython/c_hub.pyx":723
 * 
 *     if isinstance(exclude, list):
 *         if not all(isinstance(x, str) for x in exclude):             # <<<<<<<<<<<<<<
 *             raise ValueError('exclude must be a list of strings')
 * 
 */
    }

    /* "buelon/cython/c_hub.pyx":722
 *         raise ValueError('exclude must be a string or a list')
 * 
 *     if isinstance(exclude, list):             # <<<<<<<<<<<<<<
 *         if not all(isinstance(x, str) for x in exclude):
 *             raise ValueError('exclude must be a list of strings')
 */
  }

  /* "buelon/cython/c_hub.pyx":726
 *             raise ValueError('exclude must be a list of strings')
 * 
 *     allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'             # <<<<<<<<<<<<<<
 *     def clean_query_string(query_string: str) -> str:
 *         return ''.join(c for c in query_string if c in allow_chars)
 */
  __Pyx_INCREF(__pyx_kp_s_abcdefghijklmnopqrstuvwxyzABCDE);
  __Pyx_GIVEREF(__pyx_kp_s_abcdefghijklmnopqrstuvwxyzABCDE);
  __pyx_cur_scope->__pyx_v_allow_chars = __pyx_kp_s_abcdefghijklmnopqrstuvwxyzABCDE;

  /* "buelon/cython/c_hub.pyx":727
 * 
 *     allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 *     def clean_query_string(query_string: str) -> str:             # <<<<<<<<<<<<<<
 *         return ''.join(c for c in query_string if c in allow_chars)
 * 
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_query_string, __pyx_n_s_str) < 0) __PYX_ERR(0, 727, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 727, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_13_fetch_errors_1clean_query_string, 0, __pyx_n_s_fetch_errors_locals_clean_query_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_clean_query_string = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":730
 *         return ''.join(c for c in query_string if c in allow_chars)
 * 
 *     exclude_query = ''             # <<<<<<<<<<<<<<
 *     if isinstance(exclude, str):
 *         exclude_query = f' AND not (lower(msg) like \'%{clean_query_string(exclude)}%\' OR lower(trace) like \'%{clean_query_string(exclude)}%\')'
 */
  __Pyx_INCREF(__pyx_kp_s__3);
  __pyx_v_exclude_query = __pyx_kp_s__3;

  /* "buelon/cython/c_hub.pyx":731
 * 
 *     exclude_query = ''
 *     if isinstance(exclude, str):             # <<<<<<<<<<<<<<
 *         exclude_query = f' AND not (lower(msg) like \'%{clean_query_string(exclude)}%\' OR lower(trace) like \'%{clean_query_string(exclude)}%\')'
 *     elif isinstance(exclude, list):
 */
  __pyx_t_2 = PyString_Check(__pyx_v_exclude); 
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":732
 *     exclude_query = ''
 *     if isinstance(exclude, str):
 *         exclude_query = f' AND not (lower(msg) like \'%{clean_query_string(exclude)}%\' OR lower(trace) like \'%{clean_query_string(exclude)}%\')'             # <<<<<<<<<<<<<<
 *     elif isinstance(exclude, list):
 *         exclude_query = (' AND not ('
 */
    __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_AND_not_lower_msg_like);
    __pyx_t_5 += 28;
    __Pyx_GIVEREF(__pyx_kp_u_AND_not_lower_msg_like);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_AND_not_lower_msg_like);
    if (!(likely(PyString_CheckExact(__pyx_v_exclude))||((__pyx_v_exclude) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_exclude))) __PYX_ERR(0, 732, __pyx_L1_error)
    __pyx_t_4 = __pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_clean_query_string(__pyx_cur_scope->__pyx_v_clean_query_string, ((PyObject*)__pyx_v_exclude)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_OR_lower_trace_like);
    __pyx_t_5 += 26;
    __Pyx_GIVEREF(__pyx_kp_u_OR_lower_trace_like);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_OR_lower_trace_like);
    if (!(likely(PyString_CheckExact(__pyx_v_exclude))||((__pyx_v_exclude) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_exclude))) __PYX_ERR(0, 732, __pyx_L1_error)
    __pyx_t_7 = __pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_clean_query_string(__pyx_cur_scope->__pyx_v_clean_query_string, ((PyObject*)__pyx_v_exclude)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_kp_u__30);
    __pyx_t_5 += 3;
    __Pyx_GIVEREF(__pyx_kp_u__30);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__30);
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_exclude_query, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":731
 * 
 *     exclude_query = ''
 *     if isinstance(exclude, str):             # <<<<<<<<<<<<<<
 *         exclude_query = f' AND not (lower(msg) like \'%{clean_query_string(exclude)}%\' OR lower(trace) like \'%{clean_query_string(exclude)}%\')'
 *     elif isinstance(exclude, list):
 */
    goto __pyx_L10;
  }

  /* "buelon/cython/c_hub.pyx":733
 *     if isinstance(exclude, str):
 *         exclude_query = f' AND not (lower(msg) like \'%{clean_query_string(exclude)}%\' OR lower(trace) like \'%{clean_query_string(exclude)}%\')'
 *     elif isinstance(exclude, list):             # <<<<<<<<<<<<<<
 *         exclude_query = (' AND not ('
 *                          + ' OR '.join(
 */
  __pyx_t_2 = PyList_Check(__pyx_v_exclude); 
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":736
 *         exclude_query = (' AND not ('
 *                          + ' OR '.join(
 *                                 f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''             # <<<<<<<<<<<<<<
 *                                 for ex in exclude)
 *                          + ')')
 */
    __pyx_t_4 = __pyx_pf_6buelon_6cython_5c_hub_13_fetch_errors_5genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_exclude); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "buelon/cython/c_hub.pyx":735
 *     elif isinstance(exclude, list):
 *         exclude_query = (' AND not ('
 *                          + ' OR '.join(             # <<<<<<<<<<<<<<
 *                                 f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''
 *                                 for ex in exclude)
 */
    __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s_OR, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_AND_not, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":738
 *                                 f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''
 *                                 for ex in exclude)
 *                          + ')')             # <<<<<<<<<<<<<<
 * 
 *     sql = (f'SELECT id, msg, trace FROM steps WHERE status = \'{buelon.core.step.StepStatus.error.value}\''
 */
    __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_kp_s__23); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_exclude_query, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":733
 *     if isinstance(exclude, str):
 *         exclude_query = f' AND not (lower(msg) like \'%{clean_query_string(exclude)}%\' OR lower(trace) like \'%{clean_query_string(exclude)}%\')'
 *     elif isinstance(exclude, list):             # <<<<<<<<<<<<<<
 *         exclude_query = (' AND not ('
 *                          + ' OR '.join(
 */
  }
  __pyx_L10:;

  /* "buelon/cython/c_hub.pyx":740
 *                          + ')')
 * 
 *     sql = (f'SELECT id, msg, trace FROM steps WHERE status = \'{buelon.core.step.StepStatus.error.value}\''             # <<<<<<<<<<<<<<
 *            f' {exclude_query}'
 *            f' LIMIT ?')
 */
  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;
  __Pyx_INCREF(__pyx_kp_u_SELECT_id_msg_trace_FROM_steps_W);
  __pyx_t_5 += 49;
  __Pyx_GIVEREF(__pyx_kp_u_SELECT_id_msg_trace_FROM_steps_W);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_SELECT_id_msg_trace_FROM_steps_W);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_buelon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_core); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_5 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__31);

  /* "buelon/cython/c_hub.pyx":741
 * 
 *     sql = (f'SELECT id, msg, trace FROM steps WHERE status = \'{buelon.core.step.StepStatus.error.value}\''
 *            f' {exclude_query}'             # <<<<<<<<<<<<<<
 *            f' LIMIT ?')
 *     params = (count, )
 */
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_exclude_query, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_LIMIT);
  __pyx_t_5 += 8;
  __Pyx_GIVEREF(__pyx_kp_u_LIMIT);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_LIMIT);

  /* "buelon/cython/c_hub.pyx":740
 *                          + ')')
 * 
 *     sql = (f'SELECT id, msg, trace FROM steps WHERE status = \'{buelon.core.step.StepStatus.error.value}\''             # <<<<<<<<<<<<<<
 *            f' {exclude_query}'
 *            f' LIMIT ?')
 */
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sql = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":743
 *            f' {exclude_query}'
 *            f' LIMIT ?')
 *     params = (count, )             # <<<<<<<<<<<<<<
 *     error_size_query = (f'SELECT COUNT(*)'
 *                         f' FROM steps'
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_count);
  __Pyx_GIVEREF(__pyx_v_count);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_count)) __PYX_ERR(0, 743, __pyx_L1_error);
  __pyx_v_params = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":744
 *            f' LIMIT ?')
 *     params = (count, )
 *     error_size_query = (f'SELECT COUNT(*)'             # <<<<<<<<<<<<<<
 *                         f' FROM steps'
 *                         f' WHERE status = \'{buelon.core.step.StepStatus.error.value}\''
 */
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;
  __Pyx_INCREF(__pyx_kp_u_SELECT_COUNT_FROM_steps_WHERE_st);
  __pyx_t_5 += 43;
  __Pyx_GIVEREF(__pyx_kp_u_SELECT_COUNT_FROM_steps_WHERE_st);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_SELECT_COUNT_FROM_steps_WHERE_st);

  /* "buelon/cython/c_hub.pyx":746
 *     error_size_query = (f'SELECT COUNT(*)'
 *                         f' FROM steps'
 *                         f' WHERE status = \'{buelon.core.step.StepStatus.error.value}\''             # <<<<<<<<<<<<<<
 *                         f' {exclude_query}')
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_core); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_5 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__31);

  /* "buelon/cython/c_hub.pyx":747
 *                         f' FROM steps'
 *                         f' WHERE status = \'{buelon.core.step.StepStatus.error.value}\''
 *                         f' {exclude_query}')             # <<<<<<<<<<<<<<
 * 
 *     table = self.execute_db_query(sql, params, json_table=True)
 */
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_exclude_query, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":744
 *            f' LIMIT ?')
 *     params = (count, )
 *     error_size_query = (f'SELECT COUNT(*)'             # <<<<<<<<<<<<<<
 *                         f' FROM steps'
 *                         f' WHERE status = \'{buelon.core.step.StepStatus.error.value}\''
 */
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_error_size_query = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":749
 *                         f' {exclude_query}')
 * 
 *     table = self.execute_db_query(sql, params, json_table=True)             # <<<<<<<<<<<<<<
 *     error_size = self.execute_db_query(error_size_query)[0][0]
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_sql);
  __Pyx_GIVEREF(__pyx_v_sql);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_sql)) __PYX_ERR(0, 749, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_params);
  __Pyx_GIVEREF(__pyx_v_params);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_params)) __PYX_ERR(0, 749, __pyx_L1_error);
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_json_table, Py_True) < 0) __PYX_ERR(0, 749, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_table = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "buelon/cython/c_hub.pyx":750
 * 
 *     table = self.execute_db_query(sql, params, json_table=True)
 *     error_size = self.execute_db_query(error_size_query)[0][0]             # <<<<<<<<<<<<<<
 * 
 *     # with sqlite3.connect(db_path) as conn:
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_error_size_query};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_error_size = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "buelon/cython/c_hub.pyx":767
 *     #         error_size = error_size[0]
 * 
 *     for row in table:             # <<<<<<<<<<<<<<
 *         row['step'] = get_step(row['id']).to_json()
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_table)) || PyTuple_CheckExact(__pyx_v_table)) {
    __pyx_t_8 = __pyx_v_table; __Pyx_INCREF(__pyx_t_8);
    __pyx_t_5 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_table); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 767, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_8))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 767, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 767, __pyx_L1_error)
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 767, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 767, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 767, __pyx_L1_error)
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 767, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_10(__pyx_t_8);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 767, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "buelon/cython/c_hub.pyx":768
 * 
 *     for row in table:
 *         row['step'] = get_step(row['id']).to_json()             # <<<<<<<<<<<<<<
 * 
 *     return {
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_id); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_11};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 768, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_to_json); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 768, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    if (unlikely((PyObject_SetItem(__pyx_v_row, __pyx_n_s_step, __pyx_t_7) < 0))) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "buelon/cython/c_hub.pyx":767
 *     #         error_size = error_size[0]
 * 
 *     for row in table:             # <<<<<<<<<<<<<<
 *         row['step'] = get_step(row['id']).to_json()
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "buelon/cython/c_hub.pyx":770
 *         row['step'] = get_step(row['id']).to_json()
 * 
 *     return {             # <<<<<<<<<<<<<<
 *         'total': error_size,
 *         'count': len(table),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "buelon/cython/c_hub.pyx":771
 * 
 *     return {
 *         'total': error_size,             # <<<<<<<<<<<<<<
 *         'count': len(table),
 *         'table': table
 */
  __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_total, __pyx_v_error_size) < 0) __PYX_ERR(0, 771, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":772
 *     return {
 *         'total': error_size,
 *         'count': len(table),             # <<<<<<<<<<<<<<
 *         'table': table
 *     }
 */
  __pyx_t_5 = PyObject_Length(__pyx_v_table); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 772, __pyx_L1_error)
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(0, 771, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":773
 *         'total': error_size,
 *         'count': len(table),
 *         'table': table             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_table, __pyx_v_table) < 0) __PYX_ERR(0, 771, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":715
 * 
 * 
 * def _fetch_errors(self: HubServer, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *     if not isinstance(count, int):
 *         raise ValueError('count must be an integer')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("buelon.cython.c_hub._fetch_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exclude_query);
  __Pyx_XDECREF(__pyx_v_sql);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XDECREF(__pyx_v_error_size_query);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_error_size);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_13_fetch_errors_4generator1);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_13_fetch_errors_7generator3);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":777
 * 
 * 
 * def get_job_statuses(job_ids: str):             # <<<<<<<<<<<<<<
 *     """
 *     Get the hub status of a step.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_73get_job_statuses(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6buelon_6cython_5c_hub_72get_job_statuses, "\n    Get the hub status of a step.\n\n    Args:\n        self: The HubServer instance.\n        step_id (str): The id of the step to retrieve.\n\n    Returns:\n        buelon.core.step.StepStatus: The status of the step.\n    ");
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_73get_job_statuses = {"get_job_statuses", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_73get_job_statuses, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6buelon_6cython_5c_hub_72get_job_statuses};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_73get_job_statuses(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_job_ids = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_job_statuses (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_job_ids,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_job_ids)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 777, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_job_statuses") < 0)) __PYX_ERR(0, 777, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_job_ids = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_job_statuses", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 777, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.get_job_statuses", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_job_ids), (&PyString_Type), 0, "job_ids", 1))) __PYX_ERR(0, 777, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_72get_job_statuses(__pyx_self, __pyx_v_job_ids);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_16get_job_statuses_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":788
 *         buelon.core.step.StepStatus: The status of the step.
 *     """
 *     job_ids = '(' + ', '.join((f"'{i}'" for i in job_ids.split(','))) + ')'             # <<<<<<<<<<<<<<
 *     sql = f'''
 * select buj.id, bsm.name
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_16get_job_statuses_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 788, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_16get_job_statuses_2generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_get_job_statuses_locals_genexpr, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 788, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.get_job_statuses.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_6buelon_6cython_5c_hub_16get_job_statuses_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_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 *);
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 788, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 788, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_split, __pyx_cur_scope->__pyx_genexpr_arg_0, __pyx_kp_s__15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __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, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 788, __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))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 788, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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, 788, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 788, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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, 788, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 788, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_5 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__8);
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_i, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_5 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__8);
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    __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();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_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, 788, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":777
 * 
 * 
 * def get_job_statuses(job_ids: str):             # <<<<<<<<<<<<<<
 *     """
 *     Get the hub status of a step.
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_72get_job_statuses(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_job_ids) {
  CYTHON_UNUSED PyObject *__pyx_v_sql = NULL;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_16get_job_statuses_2generator4 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_UCS4 __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_job_statuses", 0);
  __Pyx_INCREF(__pyx_v_job_ids);

  /* "buelon/cython/c_hub.pyx":788
 *         buelon.core.step.StepStatus: The status of the step.
 *     """
 *     job_ids = '(' + ', '.join((f"'{i}'" for i in job_ids.split(','))) + ')'             # <<<<<<<<<<<<<<
 *     sql = f'''
 * select buj.id, bsm.name
 */
  __pyx_t_1 = __pyx_pf_6buelon_6cython_5c_hub_16get_job_statuses_genexpr(NULL, __pyx_v_job_ids); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s__32, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__23); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PyString_CheckExact(__pyx_t_2)) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_job_ids, ((PyObject*)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":789
 *     """
 *     job_ids = '(' + ', '.join((f"'{i}'" for i in job_ids.split(','))) + ')'
 *     sql = f'''             # <<<<<<<<<<<<<<
 * select buj.id, bsm.name
 * from (
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_4 = 127;
  __Pyx_INCREF(__pyx_kp_u_select_buj_id_bsm_name_from_sel);
  __pyx_t_3 += 72;
  __Pyx_GIVEREF(__pyx_kp_u_select_buj_id_bsm_name_from_sel);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_select_buj_id_bsm_name_from_sel);
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_job_ids, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_4;
  __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_buj_left_join_buelon_status_map);
  __pyx_t_3 += 73;
  __Pyx_GIVEREF(__pyx_kp_u_buj_left_join_buelon_status_map);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_buj_left_join_buelon_status_map);
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_sql = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":777
 * 
 * 
 * def get_job_statuses(job_ids: str):             # <<<<<<<<<<<<<<
 *     """
 *     Get the hub status of a step.
 */

  /* 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("buelon.cython.c_hub.get_job_statuses", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sql);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_16get_job_statuses_2generator4);
  __Pyx_XDECREF(__pyx_v_job_ids);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":800
 * 
 * 
 * def get_step_status(self: HubServer, step_id: str):             # <<<<<<<<<<<<<<
 *     """
 *     Get the hub status of a step.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_75get_step_status(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6buelon_6cython_5c_hub_74get_step_status, "\n    Get the hub status of a step.\n\n    Args:\n        self: The HubServer instance.\n        step_id (str): The id of the step to retrieve.\n\n    Returns:\n        buelon.core.step.StepStatus: The status of the step.\n    ");
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_75get_step_status = {"get_step_status", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_75get_step_status, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6buelon_6cython_5c_hub_74get_step_status};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_75get_step_status(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_step_id = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_step_status (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_step_id,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 800, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_id)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 800, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("get_step_status", 1, 2, 2, 1); __PYX_ERR(0, 800, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_step_status") < 0)) __PYX_ERR(0, 800, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_step_id = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_step_status", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 800, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.get_step_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_id), (&PyString_Type), 0, "step_id", 1))) __PYX_ERR(0, 800, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_74get_step_status(__pyx_self, __pyx_v_self, __pyx_v_step_id);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_74get_step_status(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_v_sql = NULL;
  PyObject *__pyx_v_table = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_9genexpr13__pyx_v_s = NULL;
  PyObject *__pyx_9genexpr13__pyx_v_row = 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)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  unsigned int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  Py_UCS4 __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_step_status", 1);

  /* "buelon/cython/c_hub.pyx":812
 *     """
 *     global tag_usage
 *     if ',' in step_id:             # <<<<<<<<<<<<<<
 *         return [
 *             row
 */
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__15, __pyx_v_step_id, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 812, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":813
 *     global tag_usage
 *     if ',' in step_id:
 *         return [             # <<<<<<<<<<<<<<
 *             row
 *             for s in step_id.split(',')
 */
    __Pyx_XDECREF(__pyx_r);
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 813, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "buelon/cython/c_hub.pyx":815
 *         return [
 *             row
 *             for s in step_id.split(',')             # <<<<<<<<<<<<<<
 *             for row in get_step_status(self, s.strip())
 *         ]
 */
      __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_split, __pyx_v_step_id, __pyx_kp_s__15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 815, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
        __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 815, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 815, __pyx_L6_error)
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 815, __pyx_L6_error)
              #endif
              if (__pyx_t_5 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 815, __pyx_L6_error)
            #else
            __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 815, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 815, __pyx_L6_error)
              #endif
              if (__pyx_t_5 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 815, __pyx_L6_error)
            #else
            __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 815, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          }
        } else {
          __pyx_t_3 = __pyx_t_6(__pyx_t_4);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 815, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_s, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "buelon/cython/c_hub.pyx":816
 *             row
 *             for s in step_id.split(',')
 *             for row in get_step_status(self, s.strip())             # <<<<<<<<<<<<<<
 *         ]
 * 
 */
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_get_step_status); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 816, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr13__pyx_v_s, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 816, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = NULL;
        __pyx_t_11 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_11 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
          __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 816, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __pyx_t_9 = NULL;
        __pyx_t_11 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_11 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_self, __pyx_t_8};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
          __pyx_t_7 = __pyx_t_3; __Pyx_INCREF(__pyx_t_7);
          __pyx_t_12 = 0;
          __pyx_t_13 = NULL;
        } else {
          __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 816, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 816, __pyx_L6_error)
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        for (;;) {
          if (likely(!__pyx_t_13)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 816, __pyx_L6_error)
                #endif
                if (__pyx_t_12 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 816, __pyx_L6_error)
              #else
              __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_3);
              #endif
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 816, __pyx_L6_error)
                #endif
                if (__pyx_t_12 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 816, __pyx_L6_error)
              #else
              __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_3);
              #endif
            }
          } else {
            __pyx_t_3 = __pyx_t_13(__pyx_t_7);
            if (unlikely(!__pyx_t_3)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 816, __pyx_L6_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_3);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_row, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "buelon/cython/c_hub.pyx":814
 *     if ',' in step_id:
 *         return [
 *             row             # <<<<<<<<<<<<<<
 *             for s in step_id.split(',')
 *             for row in get_step_status(self, s.strip())
 */
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr13__pyx_v_row))) __PYX_ERR(0, 813, __pyx_L6_error)

          /* "buelon/cython/c_hub.pyx":816
 *             row
 *             for s in step_id.split(',')
 *             for row in get_step_status(self, s.strip())             # <<<<<<<<<<<<<<
 *         ]
 * 
 */
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "buelon/cython/c_hub.pyx":815
 *         return [
 *             row
 *             for s in step_id.split(',')             # <<<<<<<<<<<<<<
 *             for row in get_step_status(self, s.strip())
 *         ]
 */
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_row); __pyx_9genexpr13__pyx_v_row = 0;
      __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_s); __pyx_9genexpr13__pyx_v_s = 0;
      goto __pyx_L13_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_row); __pyx_9genexpr13__pyx_v_row = 0;
      __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_s); __pyx_9genexpr13__pyx_v_s = 0;
      goto __pyx_L1_error;
      __pyx_L13_exit_scope:;
    } /* exit inner scope */
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":812
 *     """
 *     global tag_usage
 *     if ',' in step_id:             # <<<<<<<<<<<<<<
 *         return [
 *             row
 */
  }

  /* "buelon/cython/c_hub.pyx":819
 *         ]
 * 
 *     sql = (f'SELECT * '             # <<<<<<<<<<<<<<
 *            f'FROM steps '
 *            f'WHERE id = \'{step_id}\'')
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 0;
  __pyx_t_14 = 127;
  __Pyx_INCREF(__pyx_kp_u_SELECT_FROM_steps_WHERE_id);
  __pyx_t_5 += 32;
  __Pyx_GIVEREF(__pyx_kp_u_SELECT_FROM_steps_WHERE_id);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_SELECT_FROM_steps_WHERE_id);

  /* "buelon/cython/c_hub.pyx":821
 *     sql = (f'SELECT * '
 *            f'FROM steps '
 *            f'WHERE id = \'{step_id}\'')             # <<<<<<<<<<<<<<
 * 
 *     table = self.execute_db_query(sql, json_table=True)
 */
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_step_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_14;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__8);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__8);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__8);

  /* "buelon/cython/c_hub.pyx":819
 *         ]
 * 
 *     sql = (f'SELECT * '             # <<<<<<<<<<<<<<
 *            f'FROM steps '
 *            f'WHERE id = \'{step_id}\'')
 */
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_5, __pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_sql = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":823
 *            f'WHERE id = \'{step_id}\'')
 * 
 *     table = self.execute_db_query(sql, json_table=True)             # <<<<<<<<<<<<<<
 * 
 *     # with sqlite3.connect(db_path) as conn:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_sql);
  __Pyx_GIVEREF(__pyx_v_sql);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sql)) __PYX_ERR(0, 823, __pyx_L1_error);
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_json_table, Py_True) < 0) __PYX_ERR(0, 823, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 823, __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_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_table = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":833
 *     #     table = [dict(zip([row[0] for row in cur.description], row)) for row in rows]
 * 
 *     for row in table:             # <<<<<<<<<<<<<<
 *         row['status'] = buelon.core.step.StepStatus(int(row['status'])).name
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_table)) || PyTuple_CheckExact(__pyx_v_table)) {
    __pyx_t_3 = __pyx_v_table; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_table); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 833, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 833, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 833, __pyx_L1_error)
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 833, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 833, __pyx_L1_error)
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 833, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "buelon/cython/c_hub.pyx":834
 * 
 *     for row in table:
 *         row['status'] = buelon.core.step.StepStatus(int(row['status'])).name             # <<<<<<<<<<<<<<
 * 
 *     return table
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_11 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_11 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 834, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely((PyObject_SetItem(__pyx_v_row, __pyx_n_s_status, __pyx_t_4) < 0))) __PYX_ERR(0, 834, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":833
 *     #     table = [dict(zip([row[0] for row in cur.description], row)) for row in rows]
 * 
 *     for row in table:             # <<<<<<<<<<<<<<
 *         row['status'] = buelon.core.step.StepStatus(int(row['status'])).name
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":836
 *         row['status'] = buelon.core.step.StepStatus(int(row['status'])).name
 * 
 *     return table             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_table);
  __pyx_r = __pyx_v_table;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":800
 * 
 * 
 * def get_step_status(self: HubServer, step_id: str):             # <<<<<<<<<<<<<<
 *     """
 *     Get the hub status of a step.
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("buelon.cython.c_hub.get_step_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sql);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_s);
  __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":839
 * 
 * 
 * def get_steps(             # <<<<<<<<<<<<<<
 *     scopes: list,
 *     limit=50,
 */

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

  /* "buelon/cython/c_hub.pyx":845
 *     status: int = buelon.core.step.StepStatus.pending.value,
 *     include_working: bool = True,
 *     reverse: bool=False,             # <<<<<<<<<<<<<<
 * ):
 *     """
 */
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_int_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_50));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_int_50))) __PYX_ERR(0, 839, __pyx_L1_error);
  __Pyx_INCREF(((PyObject *)__pyx_int_100));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_100));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_int_100))) __PYX_ERR(0, 839, __pyx_L1_error);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_status);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_status);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_status)) __PYX_ERR(0, 839, __pyx_L1_error);
  __Pyx_INCREF(((PyObject *)Py_True));
  __Pyx_GIVEREF(((PyObject *)Py_True));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_True))) __PYX_ERR(0, 839, __pyx_L1_error);
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_False))) __PYX_ERR(0, 839, __pyx_L1_error);

  /* "buelon/cython/c_hub.pyx":839
 * 
 * 
 * def get_steps(             # <<<<<<<<<<<<<<
 *     scopes: list,
 *     limit=50,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 839, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_77get_steps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6buelon_6cython_5c_hub_76get_steps, "\n    Get the steps in the scope, ordered by priority, velocity, then scope position.\n\n    Args:\n        scopes (list): A list of scopes to filter the steps.\n        limit (int): The maximum number of steps to retrieve. Defaults to 50.\n        chunk_size (int): The number of steps to fetch in each chunk. Defaults to 100.\n        status (int | buelon.core.step.StepStatus.value): The status of the steps to retrieve. Defaults to pending.\n        include_working (bool): Whether to include working steps. Defaults to True.\n        reverse (bool): Whether to reverse the order of the steps. Defaults to False.\n\n    Returns:\n        list: A list of steps ordered by priority, velocity, and scope position.\n    ");
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_77get_steps = {"get_steps", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_77get_steps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6buelon_6cython_5c_hub_76get_steps};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_77get_steps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_scopes = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_v_chunk_size = 0;
  PyObject *__pyx_v_status = 0;
  PyObject *__pyx_v_include_working = 0;
  PyObject *__pyx_v_reverse = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_steps (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scopes,&__pyx_n_s_limit,&__pyx_n_s_chunk_size,&__pyx_n_s_status,&__pyx_n_s_include_working,&__pyx_n_s_reverse,0};
    __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_50)));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_100)));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_status);
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True)));
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scopes)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 839, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_limit);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 839, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunk_size);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 839, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_status);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 839, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_include_working);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 839, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reverse);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 839, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_steps") < 0)) __PYX_ERR(0, 839, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_scopes = ((PyObject*)values[0]);
    __pyx_v_limit = values[1];
    __pyx_v_chunk_size = values[2];
    __pyx_v_status = ((PyObject*)values[3]);
    __pyx_v_include_working = values[4];
    __pyx_v_reverse = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_steps", 0, 1, 6, __pyx_nargs); __PYX_ERR(0, 839, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.get_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scopes), (&PyList_Type), 0, "scopes", 1))) __PYX_ERR(0, 840, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_status), (&PyInt_Type), 0, "status", 1))) __PYX_ERR(0, 843, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_76get_steps(__pyx_self, __pyx_v_scopes, __pyx_v_limit, __pyx_v_chunk_size, __pyx_v_status, __pyx_v_include_working, __pyx_v_reverse);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_76get_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_scopes, PyObject *__pyx_v_limit, PyObject *__pyx_v_chunk_size, PyObject *__pyx_v_status, PyObject *__pyx_v_include_working, PyObject *__pyx_v_reverse) {
  PyObject *__pyx_v_conn = NULL;
  PyObject *__pyx_v_cur = NULL;
  PyObject *__pyx_v_velocity_sql = NULL;
  PyObject *__pyx_v_tag_velocities = NULL;
  PyObject *__pyx_v_tag = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_case_statement = NULL;
  PyObject *__pyx_v_offset = NULL;
  PyObject *__pyx_v_steps = NULL;
  PyObject *__pyx_v_expiration_time = NULL;
  PyObject *__pyx_v_working_clause = NULL;
  PyObject *__pyx_v_order_by = NULL;
  PyObject *__pyx_v_sql = NULL;
  PyObject *__pyx_v_rows = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_v_step_id = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_priority = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_scope = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_velocity = NULL;
  PyObject *__pyx_v_sql_set_to_working = NULL;
  Py_ssize_t __pyx_9genexpr14__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_UCS4 __pyx_t_16;
  int __pyx_t_17;
  PyObject *(*__pyx_t_18)(PyObject *);
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *(*__pyx_t_22)(PyObject *);
  int __pyx_t_23;
  PyObject *__pyx_t_24 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_steps", 0);
  __Pyx_INCREF(__pyx_v_status);

  /* "buelon/cython/c_hub.pyx":863
 *     global tag_usage
 * 
 *     with sqlite3.connect(db_path) as conn:             # <<<<<<<<<<<<<<
 *         cur = conn.cursor()
 *         # Fetch velocities for each tag
 */
  /*with:*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sqlite3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_connect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_db_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_2 = __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_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_conn = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":864
 * 
 *     with sqlite3.connect(db_path) as conn:
 *         cur = conn.cursor()             # <<<<<<<<<<<<<<
 *         # Fetch velocities for each tag
 *         velocity_sql = 'SELECT tag, velocity FROM tags'  # f'SELECT tag, velocity FROM tags WHERE scope IN ({",".join("?" * len(scopes))})'
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_cursor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 864, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 864, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __pyx_v_cur = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":866
 *         cur = conn.cursor()
 *         # Fetch velocities for each tag
 *         velocity_sql = 'SELECT tag, velocity FROM tags'  # f'SELECT tag, velocity FROM tags WHERE scope IN ({",".join("?" * len(scopes))})'             # <<<<<<<<<<<<<<
 *         cur.execute(velocity_sql)  # (velocity_sql, (*scopes,))
 *         tag_velocities = dict(cur.fetchall())
 */
          __Pyx_INCREF(__pyx_kp_s_SELECT_tag_velocity_FROM_tags);
          __pyx_v_velocity_sql = __pyx_kp_s_SELECT_tag_velocity_FROM_tags;

          /* "buelon/cython/c_hub.pyx":867
 *         # Fetch velocities for each tag
 *         velocity_sql = 'SELECT tag, velocity FROM tags'  # f'SELECT tag, velocity FROM tags WHERE scope IN ({",".join("?" * len(scopes))})'
 *         cur.execute(velocity_sql)  # (velocity_sql, (*scopes,))             # <<<<<<<<<<<<<<
 *         tag_velocities = dict(cur.fetchall())
 * 
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_velocity_sql};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":868
 *         velocity_sql = 'SELECT tag, velocity FROM tags'  # f'SELECT tag, velocity FROM tags WHERE scope IN ({",".join("?" * len(scopes))})'
 *         cur.execute(velocity_sql)  # (velocity_sql, (*scopes,))
 *         tag_velocities = dict(cur.fetchall())             # <<<<<<<<<<<<<<
 * 
 *         # Initialize tag_usage for new tags
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_fetchall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 868, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_tag_velocities = ((PyObject*)__pyx_t_1);
          __pyx_t_1 = 0;

          /* "buelon/cython/c_hub.pyx":871
 * 
 *         # Initialize tag_usage for new tags
 *         for tag in tag_velocities:             # <<<<<<<<<<<<<<
 *             if tag not in tag_usage:
 *                 tag_usage[tag] = 0
 */
          __pyx_t_10 = 0;
          __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_tag_velocities, 1, ((PyObject *)NULL), (&__pyx_t_11), (&__pyx_t_12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XDECREF(__pyx_t_1);
          __pyx_t_1 = __pyx_t_2;
          __pyx_t_2 = 0;
          while (1) {
            __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_11, &__pyx_t_10, &__pyx_t_2, NULL, NULL, __pyx_t_12);
            if (unlikely(__pyx_t_13 == 0)) break;
            if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 871, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_2);
            __pyx_t_2 = 0;

            /* "buelon/cython/c_hub.pyx":872
 *         # Initialize tag_usage for new tags
 *         for tag in tag_velocities:
 *             if tag not in tag_usage:             # <<<<<<<<<<<<<<
 *                 tag_usage[tag] = 0
 * 
 */
            __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tag_usage); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_tag, __pyx_t_2, Py_NE)); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 872, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (__pyx_t_14) {

              /* "buelon/cython/c_hub.pyx":873
 *         for tag in tag_velocities:
 *             if tag not in tag_usage:
 *                 tag_usage[tag] = 0             # <<<<<<<<<<<<<<
 * 
 *         case_statement = ' '.join([f"WHEN ? THEN {i}" for i in range(len(scopes))])
 */
              __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tag_usage); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_2);
              if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_v_tag, __pyx_int_0) < 0))) __PYX_ERR(0, 873, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "buelon/cython/c_hub.pyx":872
 *         # Initialize tag_usage for new tags
 *         for tag in tag_velocities:
 *             if tag not in tag_usage:             # <<<<<<<<<<<<<<
 *                 tag_usage[tag] = 0
 * 
 */
            }
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "buelon/cython/c_hub.pyx":875
 *                 tag_usage[tag] = 0
 * 
 *         case_statement = ' '.join([f"WHEN ? THEN {i}" for i in range(len(scopes))])             # <<<<<<<<<<<<<<
 *         offset = 0
 *         steps = []
 */
          { /* enter inner scope */
            __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_11 = __Pyx_PyList_GET_SIZE(__pyx_v_scopes); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 875, __pyx_L7_error)
            __pyx_t_10 = __pyx_t_11;
            for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_10; __pyx_t_15+=1) {
              __pyx_9genexpr14__pyx_v_i = __pyx_t_15;
              __pyx_t_2 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_9genexpr14__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_WHEN_THEN, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 875, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
          } /* exit inner scope */
          __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__33, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_v_case_statement = ((PyObject*)__pyx_t_3);
          __pyx_t_3 = 0;

          /* "buelon/cython/c_hub.pyx":876
 * 
 *         case_statement = ' '.join([f"WHEN ? THEN {i}" for i in range(len(scopes))])
 *         offset = 0             # <<<<<<<<<<<<<<
 *         steps = []
 * 
 */
          __Pyx_INCREF(__pyx_int_0);
          __pyx_v_offset = __pyx_int_0;

          /* "buelon/cython/c_hub.pyx":877
 *         case_statement = ' '.join([f"WHEN ? THEN {i}" for i in range(len(scopes))])
 *         offset = 0
 *         steps = []             # <<<<<<<<<<<<<<
 * 
 *         expiration_time = time.time() - (60 * 60 * .2)  # (60 * 60 * 2)
 */
          __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_v_steps = ((PyObject*)__pyx_t_3);
          __pyx_t_3 = 0;

          /* "buelon/cython/c_hub.pyx":879
 *         steps = []
 * 
 *         expiration_time = time.time() - (60 * 60 * .2)  # (60 * 60 * 2)             # <<<<<<<<<<<<<<
 *         status = buelon.core.step.StepStatus(status).value
 *         working_clause = ''
 */
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __pyx_t_2 = PyFloat_FromDouble((3600.0 * .2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __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_v_expiration_time = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "buelon/cython/c_hub.pyx":880
 * 
 *         expiration_time = time.time() - (60 * 60 * .2)  # (60 * 60 * 2)
 *         status = buelon.core.step.StepStatus(status).value             # <<<<<<<<<<<<<<
 *         working_clause = ''
 *         if include_working:
 */
          __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L7_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_StepStatus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_status};
            __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_3))) __PYX_ERR(0, 880, __pyx_L7_error)
          __Pyx_DECREF_SET(__pyx_v_status, ((PyObject*)__pyx_t_3));
          __pyx_t_3 = 0;

          /* "buelon/cython/c_hub.pyx":881
 *         expiration_time = time.time() - (60 * 60 * .2)  # (60 * 60 * 2)
 *         status = buelon.core.step.StepStatus(status).value
 *         working_clause = ''             # <<<<<<<<<<<<<<
 *         if include_working:
 *             working_clause = (f' or (epoch < {expiration_time} '
 */
          __Pyx_INCREF(__pyx_kp_s__3);
          __pyx_v_working_clause = __pyx_kp_s__3;

          /* "buelon/cython/c_hub.pyx":882
 *         status = buelon.core.step.StepStatus(status).value
 *         working_clause = ''
 *         if include_working:             # <<<<<<<<<<<<<<
 *             working_clause = (f' or (epoch < {expiration_time} '
 *                               f'     and status = \'{buelon.core.step.StepStatus.working.value}\') ')
 */
          __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_include_working); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 882, __pyx_L7_error)
          if (__pyx_t_14) {

            /* "buelon/cython/c_hub.pyx":883
 *         working_clause = ''
 *         if include_working:
 *             working_clause = (f' or (epoch < {expiration_time} '             # <<<<<<<<<<<<<<
 *                               f'     and status = \'{buelon.core.step.StepStatus.working.value}\') ')
 * 
 */
            __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_11 = 0;
            __pyx_t_16 = 127;
            __Pyx_INCREF(__pyx_kp_u_or_epoch);
            __pyx_t_11 += 13;
            __Pyx_GIVEREF(__pyx_kp_u_or_epoch);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_or_epoch);
            __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_expiration_time, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_16;
            __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
            __pyx_t_1 = 0;
            __Pyx_INCREF(__pyx_kp_u_and_status);
            __pyx_t_11 += 20;
            __Pyx_GIVEREF(__pyx_kp_u_and_status);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_and_status);

            /* "buelon/cython/c_hub.pyx":884
 *         if include_working:
 *             working_clause = (f' or (epoch < {expiration_time} '
 *                               f'     and status = \'{buelon.core.step.StepStatus.working.value}\') ')             # <<<<<<<<<<<<<<
 * 
 *         order_by = 'priority desc, epoch'
 */
            __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_buelon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_core); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L7_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_StepStatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_working); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L7_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_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_16;
            __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_1);
            __pyx_t_1 = 0;
            __Pyx_INCREF(__pyx_kp_u__34);
            __pyx_t_11 += 3;
            __Pyx_GIVEREF(__pyx_kp_u__34);
            PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__34);

            /* "buelon/cython/c_hub.pyx":883
 *         working_clause = ''
 *         if include_working:
 *             working_clause = (f' or (epoch < {expiration_time} '             # <<<<<<<<<<<<<<
 *                               f'     and status = \'{buelon.core.step.StepStatus.working.value}\') ')
 * 
 */
            __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_11, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF_SET(__pyx_v_working_clause, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "buelon/cython/c_hub.pyx":882
 *         status = buelon.core.step.StepStatus(status).value
 *         working_clause = ''
 *         if include_working:             # <<<<<<<<<<<<<<
 *             working_clause = (f' or (epoch < {expiration_time} '
 *                               f'     and status = \'{buelon.core.step.StepStatus.working.value}\') ')
 */
          }

          /* "buelon/cython/c_hub.pyx":886
 *                               f'     and status = \'{buelon.core.step.StepStatus.working.value}\') ')
 * 
 *         order_by = 'priority desc, epoch'             # <<<<<<<<<<<<<<
 *         if reverse:
 *             order_by = 'priority asc, epoch'
 */
          __Pyx_INCREF(__pyx_kp_s_priority_desc_epoch);
          __pyx_v_order_by = __pyx_kp_s_priority_desc_epoch;

          /* "buelon/cython/c_hub.pyx":887
 * 
 *         order_by = 'priority desc, epoch'
 *         if reverse:             # <<<<<<<<<<<<<<
 *             order_by = 'priority asc, epoch'
 * 
 */
          __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_reverse); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 887, __pyx_L7_error)
          if (__pyx_t_14) {

            /* "buelon/cython/c_hub.pyx":888
 *         order_by = 'priority desc, epoch'
 *         if reverse:
 *             order_by = 'priority asc, epoch'             # <<<<<<<<<<<<<<
 * 
 *         while len(steps) < limit:
 */
            __Pyx_INCREF(__pyx_kp_s_priority_asc_epoch);
            __Pyx_DECREF_SET(__pyx_v_order_by, __pyx_kp_s_priority_asc_epoch);

            /* "buelon/cython/c_hub.pyx":887
 * 
 *         order_by = 'priority desc, epoch'
 *         if reverse:             # <<<<<<<<<<<<<<
 *             order_by = 'priority asc, epoch'
 * 
 */
          }

          /* "buelon/cython/c_hub.pyx":890
 *             order_by = 'priority asc, epoch'
 * 
 *         while len(steps) < limit:             # <<<<<<<<<<<<<<
 *             sql = (f'SELECT id, priority, scope, velocity, tag '
 *                    f'FROM steps '
 */
          while (1) {
            __pyx_t_11 = __Pyx_PyList_GET_SIZE(__pyx_v_steps); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 890, __pyx_L7_error)
            __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_limit, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 890, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (!__pyx_t_14) break;

            /* "buelon/cython/c_hub.pyx":891
 * 
 *         while len(steps) < limit:
 *             sql = (f'SELECT id, priority, scope, velocity, tag '             # <<<<<<<<<<<<<<
 *                    f'FROM steps '
 *                    f'WHERE scope IN ({",".join("?" * len(scopes))}) '
 */
            __pyx_t_3 = PyTuple_New(9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 891, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_11 = 0;
            __pyx_t_16 = 127;
            __Pyx_INCREF(__pyx_kp_u_SELECT_id_priority_scope_velocit);
            __pyx_t_11 += 69;
            __Pyx_GIVEREF(__pyx_kp_u_SELECT_id_priority_scope_velocit);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_SELECT_id_priority_scope_velocit);

            /* "buelon/cython/c_hub.pyx":893
 *             sql = (f'SELECT id, priority, scope, velocity, tag '
 *                    f'FROM steps '
 *                    f'WHERE scope IN ({",".join("?" * len(scopes))}) '             # <<<<<<<<<<<<<<
 *                    f'AND ('
 *                    f'   status = \'{status}\' '
 */
            __pyx_t_10 = __Pyx_PyList_GET_SIZE(__pyx_v_scopes); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 893, __pyx_L7_error)
            __pyx_t_1 = __Pyx_PySequence_Multiply(__pyx_kp_s__22, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__15, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_16;
            __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
            __pyx_t_1 = 0;
            __Pyx_INCREF(__pyx_kp_u_AND_status);
            __pyx_t_11 += 20;
            __Pyx_GIVEREF(__pyx_kp_u_AND_status);
            PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_AND_status);

            /* "buelon/cython/c_hub.pyx":895
 *                    f'WHERE scope IN ({",".join("?" * len(scopes))}) '
 *                    f'AND ('
 *                    f'   status = \'{status}\' '             # <<<<<<<<<<<<<<
 *                    f'   {working_clause}'
 *                    f')'
 */
            __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_16;
            __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_1);
            __pyx_t_1 = 0;
            __Pyx_INCREF(__pyx_kp_u__35);
            __pyx_t_11 += 5;
            __Pyx_GIVEREF(__pyx_kp_u__35);
            PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__35);

            /* "buelon/cython/c_hub.pyx":896
 *                    f'AND ('
 *                    f'   status = \'{status}\' '
 *                    f'   {working_clause}'             # <<<<<<<<<<<<<<
 *                    f')'
 *                    f'ORDER BY  '#' CASE scope {case_statement} END, '
 */
            __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_working_clause, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_16;
            __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_1);
            __pyx_t_1 = 0;
            __Pyx_INCREF(__pyx_kp_u_ORDER_BY);
            __pyx_t_11 += 14;
            __Pyx_GIVEREF(__pyx_kp_u_ORDER_BY);
            PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_kp_u_ORDER_BY);

            /* "buelon/cython/c_hub.pyx":899
 *                    f')'
 *                    f'ORDER BY  '#' CASE scope {case_statement} END, '
 *                    f'   {order_by} '  # , COALESCE(velocity, 1.0/0.0)             # <<<<<<<<<<<<<<
 *                    f'LIMIT ? OFFSET ?')
 * 
 */
            __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_order_by, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_16;
            __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_1);
            __pyx_t_1 = 0;
            __Pyx_INCREF(__pyx_kp_u_LIMIT_OFFSET);
            __pyx_t_11 += 17;
            __Pyx_GIVEREF(__pyx_kp_u_LIMIT_OFFSET);
            PyTuple_SET_ITEM(__pyx_t_3, 8, __pyx_kp_u_LIMIT_OFFSET);

            /* "buelon/cython/c_hub.pyx":891
 * 
 *         while len(steps) < limit:
 *             sql = (f'SELECT id, priority, scope, velocity, tag '             # <<<<<<<<<<<<<<
 *                    f'FROM steps '
 *                    f'WHERE scope IN ({",".join("?" * len(scopes))}) '
 */
            __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 9, __pyx_t_11, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF_SET(__pyx_v_sql, ((PyObject*)__pyx_t_1));
            __pyx_t_1 = 0;

            /* "buelon/cython/c_hub.pyx":902
 *                    f'LIMIT ? OFFSET ?')
 * 
 *             cur.execute(sql, (*scopes, #*scopes,             # <<<<<<<<<<<<<<
 *                               chunk_size, offset))
 *             rows = cur.fetchall()
 */
            __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 902, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = PySequence_List(__pyx_v_scopes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);

            /* "buelon/cython/c_hub.pyx":903
 * 
 *             cur.execute(sql, (*scopes, #*scopes,
 *                               chunk_size, offset))             # <<<<<<<<<<<<<<
 *             rows = cur.fetchall()
 *             if not rows:
 */
            if (__Pyx_ListComp_Append(__pyx_t_2, __pyx_v_chunk_size) < 0) __PYX_ERR(0, 903, __pyx_L7_error)
            if (__Pyx_ListComp_Append(__pyx_t_2, __pyx_v_offset) < 0) __PYX_ERR(0, 903, __pyx_L7_error)
            {
              PyObject *__pyx_temp = PyList_AsTuple(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_2);
              __pyx_t_2 = __pyx_temp; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __pyx_t_4 = NULL;
            __pyx_t_5 = 0;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
                __pyx_t_5 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_sql, __pyx_t_2};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __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;

            /* "buelon/cython/c_hub.pyx":904
 *             cur.execute(sql, (*scopes, #*scopes,
 *                               chunk_size, offset))
 *             rows = cur.fetchall()             # <<<<<<<<<<<<<<
 *             if not rows:
 *                 break  # Exit loop if no more rows are fetched
 */
            __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_fetchall); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 904, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = NULL;
            __pyx_t_5 = 0;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
                __pyx_t_5 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __Pyx_XDECREF_SET(__pyx_v_rows, __pyx_t_1);
            __pyx_t_1 = 0;

            /* "buelon/cython/c_hub.pyx":905
 *                               chunk_size, offset))
 *             rows = cur.fetchall()
 *             if not rows:             # <<<<<<<<<<<<<<
 *                 break  # Exit loop if no more rows are fetched
 * 
 */
            __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_rows); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 905, __pyx_L7_error)
            __pyx_t_17 = (!__pyx_t_14);
            if (__pyx_t_17) {

              /* "buelon/cython/c_hub.pyx":906
 *             rows = cur.fetchall()
 *             if not rows:
 *                 break  # Exit loop if no more rows are fetched             # <<<<<<<<<<<<<<
 * 
 *             for row in rows:
 */
              goto __pyx_L21_break;

              /* "buelon/cython/c_hub.pyx":905
 *                               chunk_size, offset))
 *             rows = cur.fetchall()
 *             if not rows:             # <<<<<<<<<<<<<<
 *                 break  # Exit loop if no more rows are fetched
 * 
 */
            }

            /* "buelon/cython/c_hub.pyx":908
 *                 break  # Exit loop if no more rows are fetched
 * 
 *             for row in rows:             # <<<<<<<<<<<<<<
 *                 step_id, priority, scope, velocity, tag = row
 *                 if tag not in tag_velocities:
 */
            if (likely(PyList_CheckExact(__pyx_v_rows)) || PyTuple_CheckExact(__pyx_v_rows)) {
              __pyx_t_1 = __pyx_v_rows; __Pyx_INCREF(__pyx_t_1);
              __pyx_t_11 = 0;
              __pyx_t_18 = NULL;
            } else {
              __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_18 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 908, __pyx_L7_error)
            }
            for (;;) {
              if (likely(!__pyx_t_18)) {
                if (likely(PyList_CheckExact(__pyx_t_1))) {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
                    #if !CYTHON_ASSUME_SAFE_MACROS
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 908, __pyx_L7_error)
                    #endif
                    if (__pyx_t_11 >= __pyx_temp) break;
                  }
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 908, __pyx_L7_error)
                  #else
                  __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L7_error)
                  __Pyx_GOTREF(__pyx_t_3);
                  #endif
                } else {
                  {
                    Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
                    #if !CYTHON_ASSUME_SAFE_MACROS
                    if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 908, __pyx_L7_error)
                    #endif
                    if (__pyx_t_11 >= __pyx_temp) break;
                  }
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 908, __pyx_L7_error)
                  #else
                  __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L7_error)
                  __Pyx_GOTREF(__pyx_t_3);
                  #endif
                }
              } else {
                __pyx_t_3 = __pyx_t_18(__pyx_t_1);
                if (unlikely(!__pyx_t_3)) {
                  PyObject* exc_type = PyErr_Occurred();
                  if (exc_type) {
                    if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                    else __PYX_ERR(0, 908, __pyx_L7_error)
                  }
                  break;
                }
                __Pyx_GOTREF(__pyx_t_3);
              }
              __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_3);
              __pyx_t_3 = 0;

              /* "buelon/cython/c_hub.pyx":909
 * 
 *             for row in rows:
 *                 step_id, priority, scope, velocity, tag = row             # <<<<<<<<<<<<<<
 *                 if tag not in tag_velocities:
 *                     tag_velocities[tag] = None
 */
              if ((likely(PyTuple_CheckExact(__pyx_v_row))) || (PyList_CheckExact(__pyx_v_row))) {
                PyObject* sequence = __pyx_v_row;
                Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
                if (unlikely(size != 5)) {
                  if (size > 5) __Pyx_RaiseTooManyValuesError(5);
                  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                  __PYX_ERR(0, 909, __pyx_L7_error)
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                if (likely(PyTuple_CheckExact(sequence))) {
                  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
                  __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
                  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
                  __pyx_t_19 = PyTuple_GET_ITEM(sequence, 3); 
                  __pyx_t_20 = PyTuple_GET_ITEM(sequence, 4); 
                } else {
                  __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
                  __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
                  __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
                  __pyx_t_19 = PyList_GET_ITEM(sequence, 3); 
                  __pyx_t_20 = PyList_GET_ITEM(sequence, 4); 
                }
                __Pyx_INCREF(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_19);
                __Pyx_INCREF(__pyx_t_20);
                #else
                {
                  Py_ssize_t i;
                  PyObject** temps[5] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_19,&__pyx_t_20};
                  for (i=0; i < 5; i++) {
                    PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 909, __pyx_L7_error)
                    __Pyx_GOTREF(item);
                    *(temps[i]) = item;
                  }
                }
                #endif
              } else {
                Py_ssize_t index = -1;
                PyObject** temps[5] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_19,&__pyx_t_20};
                __pyx_t_21 = PyObject_GetIter(__pyx_v_row); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 909, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_21);
                __pyx_t_22 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_21);
                for (index=0; index < 5; index++) {
                  PyObject* item = __pyx_t_22(__pyx_t_21); if (unlikely(!item)) goto __pyx_L25_unpacking_failed;
                  __Pyx_GOTREF(item);
                  *(temps[index]) = item;
                }
                if (__Pyx_IternextUnpackEndCheck(__pyx_t_22(__pyx_t_21), 5) < 0) __PYX_ERR(0, 909, __pyx_L7_error)
                __pyx_t_22 = NULL;
                __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                goto __pyx_L26_unpacking_done;
                __pyx_L25_unpacking_failed:;
                __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                __pyx_t_22 = NULL;
                if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
                __PYX_ERR(0, 909, __pyx_L7_error)
                __pyx_L26_unpacking_done:;
              }
              __Pyx_XDECREF_SET(__pyx_v_step_id, __pyx_t_3);
              __pyx_t_3 = 0;
              __Pyx_XDECREF_SET(__pyx_v_priority, __pyx_t_2);
              __pyx_t_2 = 0;
              __Pyx_XDECREF_SET(__pyx_v_scope, __pyx_t_4);
              __pyx_t_4 = 0;
              __Pyx_XDECREF_SET(__pyx_v_velocity, __pyx_t_19);
              __pyx_t_19 = 0;
              __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_20);
              __pyx_t_20 = 0;

              /* "buelon/cython/c_hub.pyx":910
 *             for row in rows:
 *                 step_id, priority, scope, velocity, tag = row
 *                 if tag not in tag_velocities:             # <<<<<<<<<<<<<<
 *                     tag_velocities[tag] = None
 *                     tag_usage[tag] = 0
 */
              __pyx_t_17 = (__Pyx_PyDict_ContainsTF(__pyx_v_tag, __pyx_v_tag_velocities, Py_NE)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 910, __pyx_L7_error)
              if (__pyx_t_17) {

                /* "buelon/cython/c_hub.pyx":911
 *                 step_id, priority, scope, velocity, tag = row
 *                 if tag not in tag_velocities:
 *                     tag_velocities[tag] = None             # <<<<<<<<<<<<<<
 *                     tag_usage[tag] = 0
 *                 if tag_velocities[tag] is None or tag_usage[tag] < tag_velocities[tag]:
 */
                if (unlikely((PyDict_SetItem(__pyx_v_tag_velocities, __pyx_v_tag, Py_None) < 0))) __PYX_ERR(0, 911, __pyx_L7_error)

                /* "buelon/cython/c_hub.pyx":912
 *                 if tag not in tag_velocities:
 *                     tag_velocities[tag] = None
 *                     tag_usage[tag] = 0             # <<<<<<<<<<<<<<
 *                 if tag_velocities[tag] is None or tag_usage[tag] < tag_velocities[tag]:
 *                     steps.append(step_id)  # (get_step(step_id))
 */
                __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_tag_usage); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 912, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_20);
                if (unlikely((PyObject_SetItem(__pyx_t_20, __pyx_v_tag, __pyx_int_0) < 0))) __PYX_ERR(0, 912, __pyx_L7_error)
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

                /* "buelon/cython/c_hub.pyx":910
 *             for row in rows:
 *                 step_id, priority, scope, velocity, tag = row
 *                 if tag not in tag_velocities:             # <<<<<<<<<<<<<<
 *                     tag_velocities[tag] = None
 *                     tag_usage[tag] = 0
 */
              }

              /* "buelon/cython/c_hub.pyx":913
 *                     tag_velocities[tag] = None
 *                     tag_usage[tag] = 0
 *                 if tag_velocities[tag] is None or tag_usage[tag] < tag_velocities[tag]:             # <<<<<<<<<<<<<<
 *                     steps.append(step_id)  # (get_step(step_id))
 *                     tag_usage[tag] += 1
 */
              __pyx_t_20 = __Pyx_PyDict_GetItem(__pyx_v_tag_velocities, __pyx_v_tag); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 913, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_20);
              __pyx_t_14 = (__pyx_t_20 == Py_None);
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              if (!__pyx_t_14) {
              } else {
                __pyx_t_17 = __pyx_t_14;
                goto __pyx_L29_bool_binop_done;
              }
              __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_tag_usage); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 913, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_20);
              __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_20, __pyx_v_tag); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 913, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_19);
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              __pyx_t_20 = __Pyx_PyDict_GetItem(__pyx_v_tag_velocities, __pyx_v_tag); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 913, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_20);
              __pyx_t_4 = PyObject_RichCompare(__pyx_t_19, __pyx_t_20, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 913, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 913, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_17 = __pyx_t_14;
              __pyx_L29_bool_binop_done:;
              if (__pyx_t_17) {

                /* "buelon/cython/c_hub.pyx":914
 *                     tag_usage[tag] = 0
 *                 if tag_velocities[tag] is None or tag_usage[tag] < tag_velocities[tag]:
 *                     steps.append(step_id)  # (get_step(step_id))             # <<<<<<<<<<<<<<
 *                     tag_usage[tag] += 1
 *                     if len(steps) >= limit:
 */
                __pyx_t_23 = __Pyx_PyList_Append(__pyx_v_steps, __pyx_v_step_id); if (unlikely(__pyx_t_23 == ((int)-1))) __PYX_ERR(0, 914, __pyx_L7_error)

                /* "buelon/cython/c_hub.pyx":915
 *                 if tag_velocities[tag] is None or tag_usage[tag] < tag_velocities[tag]:
 *                     steps.append(step_id)  # (get_step(step_id))
 *                     tag_usage[tag] += 1             # <<<<<<<<<<<<<<
 *                     if len(steps) >= limit:
 *                         break
 */
                __Pyx_INCREF(__pyx_v_tag);
                __pyx_t_4 = __pyx_v_tag;
                __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_tag_usage); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 915, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_20);
                __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_20, __pyx_t_4); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 915, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_19);
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                __pyx_t_20 = __Pyx_PyInt_AddObjC(__pyx_t_19, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 915, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_20);
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_tag_usage); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 915, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_19);
                if (unlikely((PyObject_SetItem(__pyx_t_19, __pyx_t_4, __pyx_t_20) < 0))) __PYX_ERR(0, 915, __pyx_L7_error)
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "buelon/cython/c_hub.pyx":916
 *                     steps.append(step_id)  # (get_step(step_id))
 *                     tag_usage[tag] += 1
 *                     if len(steps) >= limit:             # <<<<<<<<<<<<<<
 *                         break
 * 
 */
                __pyx_t_10 = __Pyx_PyList_GET_SIZE(__pyx_v_steps); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 916, __pyx_L7_error)
                __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 916, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_4);
                __pyx_t_20 = PyObject_RichCompare(__pyx_t_4, __pyx_v_limit, Py_GE); __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 916, __pyx_L7_error)
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 916, __pyx_L7_error)
                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
                if (__pyx_t_17) {

                  /* "buelon/cython/c_hub.pyx":917
 *                     tag_usage[tag] += 1
 *                     if len(steps) >= limit:
 *                         break             # <<<<<<<<<<<<<<
 * 
 *             offset += chunk_size
 */
                  goto __pyx_L24_break;

                  /* "buelon/cython/c_hub.pyx":916
 *                     steps.append(step_id)  # (get_step(step_id))
 *                     tag_usage[tag] += 1
 *                     if len(steps) >= limit:             # <<<<<<<<<<<<<<
 *                         break
 * 
 */
                }

                /* "buelon/cython/c_hub.pyx":913
 *                     tag_velocities[tag] = None
 *                     tag_usage[tag] = 0
 *                 if tag_velocities[tag] is None or tag_usage[tag] < tag_velocities[tag]:             # <<<<<<<<<<<<<<
 *                     steps.append(step_id)  # (get_step(step_id))
 *                     tag_usage[tag] += 1
 */
              }

              /* "buelon/cython/c_hub.pyx":908
 *                 break  # Exit loop if no more rows are fetched
 * 
 *             for row in rows:             # <<<<<<<<<<<<<<
 *                 step_id, priority, scope, velocity, tag = row
 *                 if tag not in tag_velocities:
 */
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L32_for_end;
            __pyx_L24_break:;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L32_for_end;
            __pyx_L32_for_end:;

            /* "buelon/cython/c_hub.pyx":919
 *                         break
 * 
 *             offset += chunk_size             # <<<<<<<<<<<<<<
 * 
 *         sql_set_to_working = f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.working.value}\', epoch = {time.time()} WHERE id IN ({", ".join("?" * len(steps))})'
 */
            __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_offset, __pyx_v_chunk_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF_SET(__pyx_v_offset, __pyx_t_1);
            __pyx_t_1 = 0;
          }
          __pyx_L21_break:;

          /* "buelon/cython/c_hub.pyx":921
 *             offset += chunk_size
 * 
 *         sql_set_to_working = f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.working.value}\', epoch = {time.time()} WHERE id IN ({", ".join("?" * len(steps))})'             # <<<<<<<<<<<<<<
 *         cur.execute(sql_set_to_working, steps)
 *         conn.commit()
 */
          __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_11 = 0;
          __pyx_t_16 = 127;
          __Pyx_INCREF(__pyx_kp_u_UPDATE_steps_SET_status);
          __pyx_t_11 += 27;
          __Pyx_GIVEREF(__pyx_kp_u_UPDATE_steps_SET_status);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_UPDATE_steps_SET_status);
          __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_buelon); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_20);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_step); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_working); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_20 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_20) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_20) : __pyx_t_16;
          __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_20);
          __Pyx_GIVEREF(__pyx_t_20);
          PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_20);
          __pyx_t_20 = 0;
          __Pyx_INCREF(__pyx_kp_u_epoch);
          __pyx_t_11 += 11;
          __Pyx_GIVEREF(__pyx_kp_u_epoch);
          PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_epoch);
          __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_19))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_19);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_19, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
            __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 921, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          }
          __pyx_t_19 = __Pyx_PyObject_FormatSimple(__pyx_t_20, __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_16;
          __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_19);
          PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_19);
          __pyx_t_19 = 0;
          __Pyx_INCREF(__pyx_kp_u_WHERE_id_IN);
          __pyx_t_11 += 14;
          __Pyx_GIVEREF(__pyx_kp_u_WHERE_id_IN);
          PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_WHERE_id_IN);
          __pyx_t_10 = __Pyx_PyList_GET_SIZE(__pyx_v_steps); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 921, __pyx_L7_error)
          __pyx_t_19 = __Pyx_PySequence_Multiply(__pyx_kp_s__22, __pyx_t_10); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_19);
          __pyx_t_20 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __pyx_t_19 = __Pyx_PyObject_FormatSimple(__pyx_t_20, __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_16;
          __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
          __Pyx_GIVEREF(__pyx_t_19);
          PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_19);
          __pyx_t_19 = 0;
          __Pyx_INCREF(__pyx_kp_u__23);
          __pyx_t_11 += 1;
          __Pyx_GIVEREF(__pyx_kp_u__23);
          PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__23);
          __pyx_t_19 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_11, __pyx_t_16); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 921, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_v_sql_set_to_working = ((PyObject*)__pyx_t_19);
          __pyx_t_19 = 0;

          /* "buelon/cython/c_hub.pyx":922
 * 
 *         sql_set_to_working = f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.working.value}\', epoch = {time.time()} WHERE id IN ({", ".join("?" * len(steps))})'
 *         cur.execute(sql_set_to_working, steps)             # <<<<<<<<<<<<<<
 *         conn.commit()
 * 
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_20 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_20)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_20);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_v_sql_set_to_working, __pyx_v_steps};
            __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
            if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 922, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

          /* "buelon/cython/c_hub.pyx":923
 *         sql_set_to_working = f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.working.value}\', epoch = {time.time()} WHERE id IN ({", ".join("?" * len(steps))})'
 *         cur.execute(sql_set_to_working, steps)
 *         conn.commit()             # <<<<<<<<<<<<<<
 * 
 *     return steps
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_commit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_20 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_20)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_20);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_20, NULL};
            __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
            if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 923, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

          /* "buelon/cython/c_hub.pyx":863
 *     global tag_usage
 * 
 *     with sqlite3.connect(db_path) as conn:             # <<<<<<<<<<<<<<
 *         cur = conn.cursor()
 *         # Fetch velocities for each tag
 */
        }
        __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_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("buelon.cython.c_hub.get_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_19, &__pyx_t_1, &__pyx_t_20) < 0) __PYX_ERR(0, 863, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_19, __pyx_t_1, __pyx_t_20); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_24 = __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_24)) __PYX_ERR(0, 863, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_24);
          __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_24);
          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
          if (__pyx_t_17 < 0) __PYX_ERR(0, 863, __pyx_L9_except_error)
          __pyx_t_14 = (!__pyx_t_17);
          if (unlikely(__pyx_t_14)) {
            __Pyx_GIVEREF(__pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ErrRestoreWithState(__pyx_t_19, __pyx_t_1, __pyx_t_20);
            __pyx_t_19 = 0; __pyx_t_1 = 0; __pyx_t_20 = 0; 
            __PYX_ERR(0, 863, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __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_L8_exception_handled:;
        __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_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__5, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 863, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L36;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L36:;
  }

  /* "buelon/cython/c_hub.pyx":925
 *         conn.commit()
 * 
 *     return steps             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_steps)) { __Pyx_RaiseUnboundLocalError("steps"); __PYX_ERR(0, 925, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_v_steps);
  __pyx_r = __pyx_v_steps;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":839
 * 
 * 
 * def get_steps(             # <<<<<<<<<<<<<<
 *     scopes: list,
 *     limit=50,
 */

  /* 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_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_AddTraceback("buelon.cython.c_hub.get_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_conn);
  __Pyx_XDECREF(__pyx_v_cur);
  __Pyx_XDECREF(__pyx_v_velocity_sql);
  __Pyx_XDECREF(__pyx_v_tag_velocities);
  __Pyx_XDECREF(__pyx_v_tag);
  __Pyx_XDECREF(__pyx_v_case_statement);
  __Pyx_XDECREF(__pyx_v_offset);
  __Pyx_XDECREF(__pyx_v_steps);
  __Pyx_XDECREF(__pyx_v_expiration_time);
  __Pyx_XDECREF(__pyx_v_working_clause);
  __Pyx_XDECREF(__pyx_v_order_by);
  __Pyx_XDECREF(__pyx_v_sql);
  __Pyx_XDECREF(__pyx_v_rows);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_step_id);
  __Pyx_XDECREF(__pyx_v_priority);
  __Pyx_XDECREF(__pyx_v_scope);
  __Pyx_XDECREF(__pyx_v_velocity);
  __Pyx_XDECREF(__pyx_v_sql_set_to_working);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":928
 * 
 * 
 * def reset_tag_usage():             # <<<<<<<<<<<<<<
 *     global tag_usage
 *     tag_usage = collections.defaultdict(int)  # {}
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_79reset_tag_usage(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_79reset_tag_usage = {"reset_tag_usage", (PyCFunction)__pyx_pw_6buelon_6cython_5c_hub_79reset_tag_usage, METH_NOARGS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_79reset_tag_usage(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset_tag_usage (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_78reset_tag_usage(__pyx_self);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_78reset_tag_usage(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset_tag_usage", 1);

  /* "buelon/cython/c_hub.pyx":930
 * def reset_tag_usage():
 *     global tag_usage
 *     tag_usage = collections.defaultdict(int)  # {}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_collections); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)(&PyInt_Type))};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tag_usage, __pyx_t_1) < 0) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":928
 * 
 * 
 * def reset_tag_usage():             # <<<<<<<<<<<<<<
 *     global tag_usage
 *     tag_usage = collections.defaultdict(int)  # {}
 */

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

/* "buelon/cython/c_hub.pyx":935
 * # Function to decrement tag usage every second
 * 
 * def decrement_tag_usage():             # <<<<<<<<<<<<<<
 *     global tag_usage
 *     while True:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_81decrement_tag_usage(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_81decrement_tag_usage = {"decrement_tag_usage", (PyCFunction)__pyx_pw_6buelon_6cython_5c_hub_81decrement_tag_usage, METH_NOARGS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_81decrement_tag_usage(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decrement_tag_usage (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_80decrement_tag_usage(__pyx_self);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_80decrement_tag_usage(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_tag = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  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;
  long __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decrement_tag_usage", 1);

  /* "buelon/cython/c_hub.pyx":937
 * def decrement_tag_usage():
 *     global tag_usage
 *     while True:             # <<<<<<<<<<<<<<
 *         time.sleep(1)  # Sleep for 1 second
 * 
 */
  while (1) {

    /* "buelon/cython/c_hub.pyx":938
 *     global tag_usage
 *     while True:
 *         time.sleep(1)  # Sleep for 1 second             # <<<<<<<<<<<<<<
 * 
 *         with tag_lock:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 938, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sleep); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 938, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_int_1};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __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;

    /* "buelon/cython/c_hub.pyx":940
 *         time.sleep(1)  # Sleep for 1 second
 * 
 *         with tag_lock:             # <<<<<<<<<<<<<<
 *             for tag in list(tag_usage.keys()):  # Use list() to create a copy of keys for safe iteration
 *                 tag_usage[tag] = max(0, tag_usage[tag] - 1)
 */
    /*with:*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_tag_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 940, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 940, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 940, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_3);
        __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;
      /*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:*/ {

            /* "buelon/cython/c_hub.pyx":941
 * 
 *         with tag_lock:
 *             for tag in list(tag_usage.keys()):  # Use list() to create a copy of keys for safe iteration             # <<<<<<<<<<<<<<
 *                 tag_usage[tag] = max(0, tag_usage[tag] - 1)
 * 
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tag_usage); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 941, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = NULL;
            __pyx_t_4 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
              if (likely(__pyx_t_3)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_3);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_2, function);
                __pyx_t_4 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
            __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1);
            __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            for (;;) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 941, __pyx_L11_error)
                #endif
                if (__pyx_t_10 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 941, __pyx_L11_error)
              #else
              __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_2);
              #endif
              __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_2);
              __pyx_t_2 = 0;

              /* "buelon/cython/c_hub.pyx":942
 *         with tag_lock:
 *             for tag in list(tag_usage.keys()):  # Use list() to create a copy of keys for safe iteration
 *                 tag_usage[tag] = max(0, tag_usage[tag] - 1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
              __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tag_usage); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 942, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_tag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 942, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 942, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __pyx_t_11 = 0;
              __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 942, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_12 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 942, __pyx_L11_error)
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 942, __pyx_L11_error)
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              if (__pyx_t_13) {
                __Pyx_INCREF(__pyx_t_2);
                __pyx_t_3 = __pyx_t_2;
              } else {
                __pyx_t_12 = __Pyx_PyInt_From_long(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 942, __pyx_L11_error)
                __Pyx_GOTREF(__pyx_t_12);
                __pyx_t_3 = __pyx_t_12;
                __pyx_t_12 = 0;
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __pyx_t_3;
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tag_usage); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 942, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_3);
              if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_v_tag, __pyx_t_2) < 0))) __PYX_ERR(0, 942, __pyx_L11_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "buelon/cython/c_hub.pyx":941
 * 
 *         with tag_lock:
 *             for tag in list(tag_usage.keys()):  # Use list() to create a copy of keys for safe iteration             # <<<<<<<<<<<<<<
 *                 tag_usage[tag] = max(0, tag_usage[tag] - 1)
 * 
 */
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "buelon/cython/c_hub.pyx":940
 *         time.sleep(1)  # Sleep for 1 second
 * 
 *         with tag_lock:             # <<<<<<<<<<<<<<
 *             for tag in list(tag_usage.keys()):  # Use list() to create a copy of keys for safe iteration
 *                 tag_usage[tag] = max(0, tag_usage[tag] - 1)
 */
          }
          __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_L18_try_end;
          __pyx_L11_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 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("buelon.cython.c_hub.decrement_tag_usage", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 940, __pyx_L13_except_error)
            __Pyx_XGOTREF(__pyx_t_1);
            __Pyx_XGOTREF(__pyx_t_2);
            __Pyx_XGOTREF(__pyx_t_3);
            __pyx_t_12 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 940, __pyx_L13_except_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 940, __pyx_L13_except_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (__pyx_t_13 < 0) __PYX_ERR(0, 940, __pyx_L13_except_error)
            __pyx_t_15 = (!__pyx_t_13);
            if (unlikely(__pyx_t_15)) {
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_XGIVEREF(__pyx_t_3);
              __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_3);
              __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; 
              __PYX_ERR(0, 940, __pyx_L13_except_error)
            }
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L12_exception_handled;
          }
          __pyx_L13_except_error:;
          __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_L12_exception_handled:;
          __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_L18_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_5) {
            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__5, NULL);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 940, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          goto __pyx_L10;
        }
        __pyx_L10:;
      }
      goto __pyx_L25;
      __pyx_L5_error:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L1_error;
      __pyx_L25:;
    }
  }

  /* "buelon/cython/c_hub.pyx":935
 * # Function to decrement tag usage every second
 * 
 * def decrement_tag_usage():             # <<<<<<<<<<<<<<
 *     global tag_usage
 *     while 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_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("buelon.cython.c_hub.decrement_tag_usage", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tag);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":946
 * 
 * class ThreadSafeSQLiteQueue:
 *     def __init__(self, path, auto_commit=True):             # <<<<<<<<<<<<<<
 *         self.path = path
 *         self.auto_commit = auto_commit
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_auto_commit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "buelon/cython/c_hub.pyx":947
 * class ThreadSafeSQLiteQueue:
 *     def __init__(self, path, auto_commit=True):
 *         self.path = path             # <<<<<<<<<<<<<<
 *         self.auto_commit = auto_commit
 *         self.local = threading.local()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_path, __pyx_v_path) < 0) __PYX_ERR(0, 947, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":948
 *     def __init__(self, path, auto_commit=True):
 *         self.path = path
 *         self.auto_commit = auto_commit             # <<<<<<<<<<<<<<
 *         self.local = threading.local()
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_auto_commit, __pyx_v_auto_commit) < 0) __PYX_ERR(0, 948, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":949
 *         self.path = path
 *         self.auto_commit = auto_commit
 *         self.local = threading.local()             # <<<<<<<<<<<<<<
 * 
 *     def _get_queue(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_local); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_local, __pyx_t_1) < 0) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":946
 * 
 * class ThreadSafeSQLiteQueue:
 *     def __init__(self, path, auto_commit=True):             # <<<<<<<<<<<<<<
 *         self.path = path
 *         self.auto_commit = auto_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_AddTraceback("buelon.cython.c_hub.ThreadSafeSQLiteQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":951
 *         self.local = threading.local()
 * 
 *     def _get_queue(self):             # <<<<<<<<<<<<<<
 *         if not hasattr(self.local, 'queue'):
 *             self.local.queue = persistqueue.SQLiteQueue(self.path, auto_commit=self.auto_commit)
 */

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

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

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

  /* "buelon/cython/c_hub.pyx":952
 * 
 *     def _get_queue(self):
 *         if not hasattr(self.local, 'queue'):             # <<<<<<<<<<<<<<
 *             self.local.queue = persistqueue.SQLiteQueue(self.path, auto_commit=self.auto_commit)
 *         return self.local.queue
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_local); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_s_queue); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 952, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "buelon/cython/c_hub.pyx":953
 *     def _get_queue(self):
 *         if not hasattr(self.local, 'queue'):
 *             self.local.queue = persistqueue.SQLiteQueue(self.path, auto_commit=self.auto_commit)             # <<<<<<<<<<<<<<
 *         return self.local.queue
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_persistqueue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SQLiteQueue); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_auto_commit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_auto_commit, __pyx_t_6) < 0) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_local); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_queue, __pyx_t_6) < 0) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":952
 * 
 *     def _get_queue(self):
 *         if not hasattr(self.local, 'queue'):             # <<<<<<<<<<<<<<
 *             self.local.queue = persistqueue.SQLiteQueue(self.path, auto_commit=self.auto_commit)
 *         return self.local.queue
 */
  }

  /* "buelon/cython/c_hub.pyx":954
 *         if not hasattr(self.local, 'queue'):
 *             self.local.queue = persistqueue.SQLiteQueue(self.path, auto_commit=self.auto_commit)
 *         return self.local.queue             # <<<<<<<<<<<<<<
 * 
 *     def put(self, item):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_local); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_queue); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":951
 *         self.local = threading.local()
 * 
 *     def _get_queue(self):             # <<<<<<<<<<<<<<
 *         if not hasattr(self.local, 'queue'):
 *             self.local.queue = persistqueue.SQLiteQueue(self.path, auto_commit=self.auto_commit)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("buelon.cython.c_hub.ThreadSafeSQLiteQueue._get_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":956
 *         return self.local.queue
 * 
 *     def put(self, item):             # <<<<<<<<<<<<<<
 *         return self._get_queue().put(item)
 * 
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_4put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("put", 1);

  /* "buelon/cython/c_hub.pyx":957
 * 
 *     def put(self, item):
 *         return self._get_queue().put(item)             # <<<<<<<<<<<<<<
 * 
 *     def get(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_queue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __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_put); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __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;

  /* "buelon/cython/c_hub.pyx":956
 *         return self.local.queue
 * 
 *     def put(self, item):             # <<<<<<<<<<<<<<
 *         return self._get_queue().put(item)
 * 
 */

  /* 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("buelon.cython.c_hub.ThreadSafeSQLiteQueue.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":959
 *         return self._get_queue().put(item)
 * 
 *     def get(self):             # <<<<<<<<<<<<<<
 *         return self._get_queue().get()
 * 
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_6get(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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 1);

  /* "buelon/cython/c_hub.pyx":960
 * 
 *     def get(self):
 *         return self._get_queue().get()             # <<<<<<<<<<<<<<
 * 
 *     def task_done(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_queue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __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_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __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;

  /* "buelon/cython/c_hub.pyx":959
 *         return self._get_queue().put(item)
 * 
 *     def get(self):             # <<<<<<<<<<<<<<
 *         return self._get_queue().get()
 * 
 */

  /* 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("buelon.cython.c_hub.ThreadSafeSQLiteQueue.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":962
 *         return self._get_queue().get()
 * 
 *     def task_done(self):             # <<<<<<<<<<<<<<
 *         return self._get_queue().task_done()
 * 
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_8task_done(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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("task_done", 1);

  /* "buelon/cython/c_hub.pyx":963
 * 
 *     def task_done(self):
 *         return self._get_queue().task_done()             # <<<<<<<<<<<<<<
 * 
 *     def qsize(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_queue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __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_task_done); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __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;

  /* "buelon/cython/c_hub.pyx":962
 *         return self._get_queue().get()
 * 
 *     def task_done(self):             # <<<<<<<<<<<<<<
 *         return self._get_queue().task_done()
 * 
 */

  /* 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("buelon.cython.c_hub.ThreadSafeSQLiteQueue.task_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":965
 *         return self._get_queue().task_done()
 * 
 *     def qsize(self):             # <<<<<<<<<<<<<<
 *         return self._get_queue().qsize()
 * 
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_10qsize(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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("qsize", 1);

  /* "buelon/cython/c_hub.pyx":966
 * 
 *     def qsize(self):
 *         return self._get_queue().qsize()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_queue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __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_qsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __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;

  /* "buelon/cython/c_hub.pyx":965
 *         return self._get_queue().task_done()
 * 
 *     def qsize(self):             # <<<<<<<<<<<<<<
 *         return self._get_queue().qsize()
 * 
 */

  /* 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("buelon.cython.c_hub.ThreadSafeSQLiteQueue.qsize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":970
 * 
 * class HubServer:
 *     def __init__(self, host='0.0.0.0', port=65432):             # <<<<<<<<<<<<<<
 *         self.host = host
 *         self.port = port
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubServer_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubServer_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubServer_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubServer_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_port = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_host,&__pyx_n_s_port,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_kp_s_0_0_0_0)));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_65432)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 970, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_host);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 970, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_port);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 970, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 970, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_host = values[1];
    __pyx_v_port = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 970, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubServer___init__(__pyx_self, __pyx_v_self, __pyx_v_host, __pyx_v_port);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "buelon/cython/c_hub.pyx":971
 * class HubServer:
 *     def __init__(self, host='0.0.0.0', port=65432):
 *         self.host = host             # <<<<<<<<<<<<<<
 *         self.port = port
 *         self.transaction_queue = queue.Queue()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_host, __pyx_v_host) < 0) __PYX_ERR(0, 971, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":972
 *     def __init__(self, host='0.0.0.0', port=65432):
 *         self.host = host
 *         self.port = port             # <<<<<<<<<<<<<<
 *         self.transaction_queue = queue.Queue()
 *         # self.execution_queue = queue.Queue()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_port, __pyx_v_port) < 0) __PYX_ERR(0, 972, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":973
 *         self.host = host
 *         self.port = port
 *         self.transaction_queue = queue.Queue()             # <<<<<<<<<<<<<<
 *         # self.execution_queue = queue.Queue()
 *         self.execution_queue = ThreadSafeSQLiteQueue('execution_queue', auto_commit=True)  # persistqueue.SQLiteQueue('execution_queue', auto_commit=True)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_queue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Queue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_transaction_queue, __pyx_t_1) < 0) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":975
 *         self.transaction_queue = queue.Queue()
 *         # self.execution_queue = queue.Queue()
 *         self.execution_queue = ThreadSafeSQLiteQueue('execution_queue', auto_commit=True)  # persistqueue.SQLiteQueue('execution_queue', auto_commit=True)             # <<<<<<<<<<<<<<
 *         self.db_pool = self.create_db_pool()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ThreadSafeSQLiteQueue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_auto_commit, Py_True) < 0) __PYX_ERR(0, 975, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__36, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __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;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_execution_queue, __pyx_t_2) < 0) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":976
 *         # self.execution_queue = queue.Queue()
 *         self.execution_queue = ThreadSafeSQLiteQueue('execution_queue', auto_commit=True)  # persistqueue.SQLiteQueue('execution_queue', auto_commit=True)
 *         self.db_pool = self.create_db_pool()             # <<<<<<<<<<<<<<
 * 
 *     def create_db_pool(self, max_connections=10):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_create_db_pool); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_db_pool, __pyx_t_2) < 0) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":970
 * 
 * class HubServer:
 *     def __init__(self, host='0.0.0.0', port=65432):             # <<<<<<<<<<<<<<
 *         self.host = host
 *         self.port = port
 */

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

/* "buelon/cython/c_hub.pyx":978
 *         self.db_pool = self.create_db_pool()
 * 
 *     def create_db_pool(self, max_connections=10):             # <<<<<<<<<<<<<<
 *         return ThreadPoolExecutor(max_workers=max_connections)
 * 
 */

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

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

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

  /* "buelon/cython/c_hub.pyx":979
 * 
 *     def create_db_pool(self, max_connections=10):
 *         return ThreadPoolExecutor(max_workers=max_connections)             # <<<<<<<<<<<<<<
 * 
 *     def execute_db_query(self, query, params=None, json_table=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ThreadPoolExecutor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_max_workers, __pyx_v_max_connections) < 0) __PYX_ERR(0, 979, __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, 979, __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;

  /* "buelon/cython/c_hub.pyx":978
 *         self.db_pool = self.create_db_pool()
 * 
 *     def create_db_pool(self, max_connections=10):             # <<<<<<<<<<<<<<
 *         return ThreadPoolExecutor(max_workers=max_connections)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer.create_db_pool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":981
 *         return ThreadPoolExecutor(max_workers=max_connections)
 * 
 *     def execute_db_query(self, query, params=None, json_table=False):             # <<<<<<<<<<<<<<
 *         def db_operation():
 *             with sqlite3.connect(db_path) as conn:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubServer_5execute_db_query(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubServer_5execute_db_query = {"execute_db_query", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubServer_5execute_db_query, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubServer_5execute_db_query(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_params = 0;
  PyObject *__pyx_v_json_table = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute_db_query (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_query,&__pyx_n_s_params,&__pyx_n_s_json_table,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 981, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 981, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("execute_db_query", 0, 2, 4, 1); __PYX_ERR(0, 981, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 981, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_json_table);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 981, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "execute_db_query") < 0)) __PYX_ERR(0, 981, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_query = values[1];
    __pyx_v_params = values[2];
    __pyx_v_json_table = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("execute_db_query", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 981, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer.execute_db_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubServer_4execute_db_query(__pyx_self, __pyx_v_self, __pyx_v_query, __pyx_v_params, __pyx_v_json_table);

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

/* "buelon/cython/c_hub.pyx":982
 * 
 *     def execute_db_query(self, query, params=None, json_table=False):
 *         def db_operation():             # <<<<<<<<<<<<<<
 *             with sqlite3.connect(db_path) as conn:
 *                 cur = conn.cursor()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubServer_16execute_db_query_1db_operation(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubServer_16execute_db_query_1db_operation = {"db_operation", (PyCFunction)__pyx_pw_6buelon_6cython_5c_hub_9HubServer_16execute_db_query_1db_operation, METH_NOARGS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubServer_16execute_db_query_1db_operation(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("db_operation (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubServer_16execute_db_query_db_operation(__pyx_self);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_16execute_db_query_db_operation(PyObject *__pyx_self) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query *__pyx_cur_scope;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query *__pyx_outer_scope;
  PyObject *__pyx_v_conn = NULL;
  PyObject *__pyx_v_cur = NULL;
  PyObject *__pyx_v_headers = NULL;
  PyObject *__pyx_v_table = NULL;
  PyObject *__pyx_9genexpr15__pyx_v_row = NULL;
  PyObject *__pyx_9genexpr16__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;
  unsigned 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;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("db_operation", 1);
  __pyx_outer_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "buelon/cython/c_hub.pyx":983
 *     def execute_db_query(self, query, params=None, json_table=False):
 *         def db_operation():
 *             with sqlite3.connect(db_path) as conn:             # <<<<<<<<<<<<<<
 *                 cur = conn.cursor()
 *                 if params:
 */
  /*with:*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sqlite3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_connect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_db_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 983, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_2 = __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_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_conn = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":984
 *         def db_operation():
 *             with sqlite3.connect(db_path) as conn:
 *                 cur = conn.cursor()             # <<<<<<<<<<<<<<
 *                 if params:
 *                     cur.execute(query, params)
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_cursor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __pyx_v_cur = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":985
 *             with sqlite3.connect(db_path) as conn:
 *                 cur = conn.cursor()
 *                 if params:             # <<<<<<<<<<<<<<
 *                     cur.execute(query, params)
 *                 else:
 */
          if (unlikely(!__pyx_cur_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 985, __pyx_L7_error) }
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_params); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 985, __pyx_L7_error)
          if (__pyx_t_10) {

            /* "buelon/cython/c_hub.pyx":986
 *                 cur = conn.cursor()
 *                 if params:
 *                     cur.execute(query, params)             # <<<<<<<<<<<<<<
 *                 else:
 *                     cur.execute(query)
 */
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            if (unlikely(!__pyx_cur_scope->__pyx_v_query)) { __Pyx_RaiseClosureNameError("query"); __PYX_ERR(0, 986, __pyx_L7_error) }
            if (unlikely(!__pyx_cur_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 986, __pyx_L7_error) }
            __pyx_t_3 = NULL;
            __pyx_t_5 = 0;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
              if (likely(__pyx_t_3)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                __Pyx_INCREF(__pyx_t_3);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_1, function);
                __pyx_t_5 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_query, __pyx_cur_scope->__pyx_v_params};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "buelon/cython/c_hub.pyx":985
 *             with sqlite3.connect(db_path) as conn:
 *                 cur = conn.cursor()
 *                 if params:             # <<<<<<<<<<<<<<
 *                     cur.execute(query, params)
 *                 else:
 */
            goto __pyx_L13;
          }

          /* "buelon/cython/c_hub.pyx":988
 *                     cur.execute(query, params)
 *                 else:
 *                     cur.execute(query)             # <<<<<<<<<<<<<<
 *                 conn.commit()
 *                 if json_table:
 */
          /*else*/ {
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            if (unlikely(!__pyx_cur_scope->__pyx_v_query)) { __Pyx_RaiseClosureNameError("query"); __PYX_ERR(0, 988, __pyx_L7_error) }
            __pyx_t_3 = NULL;
            __pyx_t_5 = 0;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
              if (likely(__pyx_t_3)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                __Pyx_INCREF(__pyx_t_3);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_1, function);
                __pyx_t_5 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_query};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 988, __pyx_L7_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_L13:;

          /* "buelon/cython/c_hub.pyx":989
 *                 else:
 *                     cur.execute(query)
 *                 conn.commit()             # <<<<<<<<<<<<<<
 *                 if json_table:
 *                     headers = [row[0] for row in cur.description]
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_commit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":990
 *                     cur.execute(query)
 *                 conn.commit()
 *                 if json_table:             # <<<<<<<<<<<<<<
 *                     headers = [row[0] for row in cur.description]
 *                     table = [dict(zip(headers, row)) for row in cur.fetchall()]
 */
          if (unlikely(!__pyx_cur_scope->__pyx_v_json_table)) { __Pyx_RaiseClosureNameError("json_table"); __PYX_ERR(0, 990, __pyx_L7_error) }
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_json_table); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 990, __pyx_L7_error)
          if (__pyx_t_10) {

            /* "buelon/cython/c_hub.pyx":991
 *                 conn.commit()
 *                 if json_table:
 *                     headers = [row[0] for row in cur.description]             # <<<<<<<<<<<<<<
 *                     table = [dict(zip(headers, row)) for row in cur.fetchall()]
 *                     return table
 */
            { /* enter inner scope */
              __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 991, __pyx_L17_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_description); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L17_error)
              __Pyx_GOTREF(__pyx_t_1);
              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_11 = 0;
                __pyx_t_12 = NULL;
              } else {
                __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 991, __pyx_L17_error)
                __Pyx_GOTREF(__pyx_t_3);
                __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 991, __pyx_L17_error)
              }
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              for (;;) {
                if (likely(!__pyx_t_12)) {
                  if (likely(PyList_CheckExact(__pyx_t_3))) {
                    {
                      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
                      #if !CYTHON_ASSUME_SAFE_MACROS
                      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 991, __pyx_L17_error)
                      #endif
                      if (__pyx_t_11 >= __pyx_temp) break;
                    }
                    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 991, __pyx_L17_error)
                    #else
                    __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L17_error)
                    __Pyx_GOTREF(__pyx_t_1);
                    #endif
                  } else {
                    {
                      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
                      #if !CYTHON_ASSUME_SAFE_MACROS
                      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 991, __pyx_L17_error)
                      #endif
                      if (__pyx_t_11 >= __pyx_temp) break;
                    }
                    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 991, __pyx_L17_error)
                    #else
                    __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L17_error)
                    __Pyx_GOTREF(__pyx_t_1);
                    #endif
                  }
                } else {
                  __pyx_t_1 = __pyx_t_12(__pyx_t_3);
                  if (unlikely(!__pyx_t_1)) {
                    PyObject* exc_type = PyErr_Occurred();
                    if (exc_type) {
                      if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                      else __PYX_ERR(0, 991, __pyx_L17_error)
                    }
                    break;
                  }
                  __Pyx_GOTREF(__pyx_t_1);
                }
                __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_row, __pyx_t_1);
                __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_GetItemInt(__pyx_9genexpr15__pyx_v_row, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L17_error)
                __Pyx_GOTREF(__pyx_t_1);
                if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 991, __pyx_L17_error)
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              }
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_row); __pyx_9genexpr15__pyx_v_row = 0;
              goto __pyx_L21_exit_scope;
              __pyx_L17_error:;
              __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_row); __pyx_9genexpr15__pyx_v_row = 0;
              goto __pyx_L7_error;
              __pyx_L21_exit_scope:;
            } /* exit inner scope */
            __pyx_v_headers = ((PyObject*)__pyx_t_2);
            __pyx_t_2 = 0;

            /* "buelon/cython/c_hub.pyx":992
 *                 if json_table:
 *                     headers = [row[0] for row in cur.description]
 *                     table = [dict(zip(headers, row)) for row in cur.fetchall()]             # <<<<<<<<<<<<<<
 *                     return table
 *                 return cur.fetchall()
 */
            { /* enter inner scope */
              __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L24_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_fetchall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L24_error)
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_4 = NULL;
              __pyx_t_5 = 0;
              #if CYTHON_UNPACK_METHODS
              if (likely(PyMethod_Check(__pyx_t_1))) {
                __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
                if (likely(__pyx_t_4)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                  __Pyx_INCREF(__pyx_t_4);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_1, function);
                  __pyx_t_5 = 1;
                }
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
                __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 992, __pyx_L24_error)
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              }
              if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
                __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1);
                __pyx_t_11 = 0;
                __pyx_t_12 = NULL;
              } else {
                __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L24_error)
                __Pyx_GOTREF(__pyx_t_1);
                __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 992, __pyx_L24_error)
              }
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              for (;;) {
                if (likely(!__pyx_t_12)) {
                  if (likely(PyList_CheckExact(__pyx_t_1))) {
                    {
                      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
                      #if !CYTHON_ASSUME_SAFE_MACROS
                      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 992, __pyx_L24_error)
                      #endif
                      if (__pyx_t_11 >= __pyx_temp) break;
                    }
                    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 992, __pyx_L24_error)
                    #else
                    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 992, __pyx_L24_error)
                    __Pyx_GOTREF(__pyx_t_3);
                    #endif
                  } else {
                    {
                      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
                      #if !CYTHON_ASSUME_SAFE_MACROS
                      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 992, __pyx_L24_error)
                      #endif
                      if (__pyx_t_11 >= __pyx_temp) break;
                    }
                    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 992, __pyx_L24_error)
                    #else
                    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 992, __pyx_L24_error)
                    __Pyx_GOTREF(__pyx_t_3);
                    #endif
                  }
                } else {
                  __pyx_t_3 = __pyx_t_12(__pyx_t_1);
                  if (unlikely(!__pyx_t_3)) {
                    PyObject* exc_type = PyErr_Occurred();
                    if (exc_type) {
                      if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                      else __PYX_ERR(0, 992, __pyx_L24_error)
                    }
                    break;
                  }
                  __Pyx_GOTREF(__pyx_t_3);
                }
                __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_row, __pyx_t_3);
                __pyx_t_3 = 0;
                __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 992, __pyx_L24_error)
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_INCREF(__pyx_v_headers);
                __Pyx_GIVEREF(__pyx_v_headers);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_headers)) __PYX_ERR(0, 992, __pyx_L24_error);
                __Pyx_INCREF(__pyx_9genexpr16__pyx_v_row);
                __Pyx_GIVEREF(__pyx_9genexpr16__pyx_v_row);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_9genexpr16__pyx_v_row)) __PYX_ERR(0, 992, __pyx_L24_error);
                __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 992, __pyx_L24_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 992, __pyx_L24_error)
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 992, __pyx_L24_error)
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              }
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_row); __pyx_9genexpr16__pyx_v_row = 0;
              goto __pyx_L28_exit_scope;
              __pyx_L24_error:;
              __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_row); __pyx_9genexpr16__pyx_v_row = 0;
              goto __pyx_L7_error;
              __pyx_L28_exit_scope:;
            } /* exit inner scope */
            __pyx_v_table = ((PyObject*)__pyx_t_2);
            __pyx_t_2 = 0;

            /* "buelon/cython/c_hub.pyx":993
 *                     headers = [row[0] for row in cur.description]
 *                     table = [dict(zip(headers, row)) for row in cur.fetchall()]
 *                     return table             # <<<<<<<<<<<<<<
 *                 return cur.fetchall()
 * 
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(__pyx_v_table);
            __pyx_r = __pyx_v_table;
            goto __pyx_L11_try_return;

            /* "buelon/cython/c_hub.pyx":990
 *                     cur.execute(query)
 *                 conn.commit()
 *                 if json_table:             # <<<<<<<<<<<<<<
 *                     headers = [row[0] for row in cur.description]
 *                     table = [dict(zip(headers, row)) for row in cur.fetchall()]
 */
          }

          /* "buelon/cython/c_hub.pyx":994
 *                     table = [dict(zip(headers, row)) for row in cur.fetchall()]
 *                     return table
 *                 return cur.fetchall()             # <<<<<<<<<<<<<<
 * 
 *         return self.db_pool.submit(db_operation).result()
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_fetchall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L7_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_L11_try_return;

          /* "buelon/cython/c_hub.pyx":983
 *     def execute_db_query(self, query, params=None, json_table=False):
 *         def db_operation():
 *             with sqlite3.connect(db_path) as conn:             # <<<<<<<<<<<<<<
 *                 cur = conn.cursor()
 *                 if params:
 */
        }
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("buelon.cython.c_hub.HubServer.execute_db_query.db_operation", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 983, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_3);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 983, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_13 = __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_13)) __PYX_ERR(0, 983, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (__pyx_t_10 < 0) __PYX_ERR(0, 983, __pyx_L9_except_error)
          __pyx_t_14 = (!__pyx_t_10);
          if (unlikely(__pyx_t_14)) {
            __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, 983, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __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_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_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__5, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 983, __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_6) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__5, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 983, __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_L32;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L32:;
  }

  /* "buelon/cython/c_hub.pyx":982
 * 
 *     def execute_db_query(self, query, params=None, json_table=False):
 *         def db_operation():             # <<<<<<<<<<<<<<
 *             with sqlite3.connect(db_path) as conn:
 *                 cur = conn.cursor()
 */

  /* 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("buelon.cython.c_hub.HubServer.execute_db_query.db_operation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_conn);
  __Pyx_XDECREF(__pyx_v_cur);
  __Pyx_XDECREF(__pyx_v_headers);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_row);
  __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":981
 *         return ThreadPoolExecutor(max_workers=max_connections)
 * 
 *     def execute_db_query(self, query, params=None, json_table=False):             # <<<<<<<<<<<<<<
 *         def db_operation():
 *             with sqlite3.connect(db_path) as conn:
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_4execute_db_query(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_params, PyObject *__pyx_v_json_table) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query *__pyx_cur_scope;
  PyObject *__pyx_v_db_operation = 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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("execute_db_query", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 981, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_query = __pyx_v_query;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_query);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_query);
  __pyx_cur_scope->__pyx_v_params = __pyx_v_params;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_params);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_params);
  __pyx_cur_scope->__pyx_v_json_table = __pyx_v_json_table;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_json_table);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_json_table);

  /* "buelon/cython/c_hub.pyx":982
 * 
 *     def execute_db_query(self, query, params=None, json_table=False):
 *         def db_operation():             # <<<<<<<<<<<<<<
 *             with sqlite3.connect(db_path) as conn:
 *                 cur = conn.cursor()
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubServer_16execute_db_query_1db_operation, 0, __pyx_n_s_HubServer_execute_db_query_local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_db_operation = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":996
 *                 return cur.fetchall()
 * 
 *         return self.db_pool.submit(db_operation).result()             # <<<<<<<<<<<<<<
 * 
 *     def start(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db_pool); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_submit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_db_operation};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 996, __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_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":981
 *         return ThreadPoolExecutor(max_workers=max_connections)
 * 
 *     def execute_db_query(self, query, params=None, json_table=False):             # <<<<<<<<<<<<<<
 *         def db_operation():
 *             with sqlite3.connect(db_path) as conn:
 */

  /* 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("buelon.cython.c_hub.HubServer.execute_db_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_db_operation);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":998
 *         return self.db_pool.submit(db_operation).result()
 * 
 *     def start(self):             # <<<<<<<<<<<<<<
 *         server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 *         try:
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_6start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_server = NULL;
  PyObject *__pyx_v_attempts = NULL;
  PyObject *__pyx_v_attempt = NULL;
  PyObject *__pyx_v_worker_thread = NULL;
  PyObject *__pyx_v_executor_thread = NULL;
  PyObject *__pyx_v_client_socket = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_addr = NULL;
  PyObject *__pyx_v_client_thread = 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;
  unsigned int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  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;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_UCS4 __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  PyObject *(*__pyx_t_19)(PyObject *);
  int __pyx_t_20;
  char const *__pyx_t_21;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 1);

  /* "buelon/cython/c_hub.pyx":999
 * 
 *     def start(self):
 *         server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)             # <<<<<<<<<<<<<<
 *         try:
 *             attempts = 5
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AF_INET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SOCK_STREAM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_server = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1000
 *     def start(self):
 *         server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 *         try:             # <<<<<<<<<<<<<<
 *             attempts = 5
 *             for attempt in range(1, attempts + 1):
 */
  /*try:*/ {

    /* "buelon/cython/c_hub.pyx":1001
 *         server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 *         try:
 *             attempts = 5             # <<<<<<<<<<<<<<
 *             for attempt in range(1, attempts + 1):
 *                 try:
 */
    __Pyx_INCREF(__pyx_int_5);
    __pyx_v_attempts = __pyx_int_5;

    /* "buelon/cython/c_hub.pyx":1002
 *         try:
 *             attempts = 5
 *             for attempt in range(1, attempts + 1):             # <<<<<<<<<<<<<<
 *                 try:
 *                     server.bind((self.host, self.port))
 */
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_attempts, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_1)) __PYX_ERR(0, 1002, __pyx_L4_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L4_error);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L4_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_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1002, __pyx_L4_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1002, __pyx_L4_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 1002, __pyx_L4_error)
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1002, __pyx_L4_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 1002, __pyx_L4_error)
          #else
          __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_8(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1002, __pyx_L4_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_attempt, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "buelon/cython/c_hub.pyx":1003
 *             attempts = 5
 *             for attempt in range(1, attempts + 1):
 *                 try:             # <<<<<<<<<<<<<<
 *                     server.bind((self.host, self.port))
 *                     break
 */
      {
        __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:*/ {

          /* "buelon/cython/c_hub.pyx":1004
 *             for attempt in range(1, attempts + 1):
 *                 try:
 *                     server.bind((self.host, self.port))             # <<<<<<<<<<<<<<
 *                     break
 *                 except OSError:
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_bind); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1004, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_host); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1004, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_port); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1004, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GIVEREF(__pyx_t_4);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4)) __PYX_ERR(0, 1004, __pyx_L8_error);
          __Pyx_GIVEREF(__pyx_t_2);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L8_error);
          __pyx_t_4 = 0;
          __pyx_t_2 = 0;
          __pyx_t_2 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_12};
            __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "buelon/cython/c_hub.pyx":1005
 *                 try:
 *                     server.bind((self.host, self.port))
 *                     break             # <<<<<<<<<<<<<<
 *                 except OSError:
 *                     print(f"Port {self.port} is already in use. Retrying...")
 */
          goto __pyx_L13_try_break;

          /* "buelon/cython/c_hub.pyx":1003
 *             attempts = 5
 *             for attempt in range(1, attempts + 1):
 *                 try:             # <<<<<<<<<<<<<<
 *                     server.bind((self.host, self.port))
 *                     break
 */
        }
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "buelon/cython/c_hub.pyx":1006
 *                     server.bind((self.host, self.port))
 *                     break
 *                 except OSError:             # <<<<<<<<<<<<<<
 *                     print(f"Port {self.port} is already in use. Retrying...")
 *                     time.sleep(5 * attempt)
 */
        __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OSError);
        if (__pyx_t_13) {
          __Pyx_AddTraceback("buelon.cython.c_hub.HubServer.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_12) < 0) __PYX_ERR(0, 1006, __pyx_L10_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_12);

          /* "buelon/cython/c_hub.pyx":1007
 *                     break
 *                 except OSError:
 *                     print(f"Port {self.port} is already in use. Retrying...")             # <<<<<<<<<<<<<<
 *                     time.sleep(5 * attempt)
 *                     if attempt == attempts:
 */
          __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1007, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_14 = 0;
          __pyx_t_15 = 127;
          __Pyx_INCREF(__pyx_kp_u_Port);
          __pyx_t_14 += 5;
          __Pyx_GIVEREF(__pyx_kp_u_Port);
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Port);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_port); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1007, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_16 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1007, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16) : __pyx_t_15;
          __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_16);
          __Pyx_GIVEREF(__pyx_t_16);
          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_16);
          __pyx_t_16 = 0;
          __Pyx_INCREF(__pyx_kp_u_is_already_in_use_Retrying);
          __pyx_t_14 += 31;
          __Pyx_GIVEREF(__pyx_kp_u_is_already_in_use_Retrying);
          PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_is_already_in_use_Retrying);
          __pyx_t_16 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1007, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1007, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":1008
 *                 except OSError:
 *                     print(f"Port {self.port} is already in use. Retrying...")
 *                     time.sleep(5 * attempt)             # <<<<<<<<<<<<<<
 *                     if attempt == attempts:
 *                         raise
 */
          __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_time); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1008, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_sleep); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1008, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __pyx_t_16 = __Pyx_PyInt_MultiplyCObj(__pyx_int_5, __pyx_v_attempt, 5, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1008, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_17 = NULL;
          __pyx_t_6 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_17)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_17);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
              __pyx_t_6 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_t_16};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
            __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":1009
 *                     print(f"Port {self.port} is already in use. Retrying...")
 *                     time.sleep(5 * attempt)
 *                     if attempt == attempts:             # <<<<<<<<<<<<<<
 *                         raise
 *             server.listen()
 */
          __pyx_t_2 = PyObject_RichCompare(__pyx_v_attempt, __pyx_v_attempts, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1009, __pyx_L10_except_error)
          __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1009, __pyx_L10_except_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(__pyx_t_18)) {

            /* "buelon/cython/c_hub.pyx":1010
 *                     time.sleep(5 * attempt)
 *                     if attempt == attempts:
 *                         raise             # <<<<<<<<<<<<<<
 *             server.listen()
 *             print(f"Server listening on {self.host}:{self.port}")
 */
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_5, __pyx_t_12);
            __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_12 = 0; 
            __PYX_ERR(0, 1010, __pyx_L10_except_error)

            /* "buelon/cython/c_hub.pyx":1009
 *                     print(f"Port {self.port} is already in use. Retrying...")
 *                     time.sleep(5 * attempt)
 *                     if attempt == attempts:             # <<<<<<<<<<<<<<
 *                         raise
 *             server.listen()
 */
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          goto __pyx_L9_exception_handled;
        }
        goto __pyx_L10_except_error;

        /* "buelon/cython/c_hub.pyx":1003
 *             attempts = 5
 *             for attempt in range(1, attempts + 1):
 *                 try:             # <<<<<<<<<<<<<<
 *                     server.bind((self.host, self.port))
 *                     break
 */
        __pyx_L10_except_error:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L4_error;
        __pyx_L13_try_break:;
        __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_L7_break;
        __pyx_L9_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }

      /* "buelon/cython/c_hub.pyx":1002
 *         try:
 *             attempts = 5
 *             for attempt in range(1, attempts + 1):             # <<<<<<<<<<<<<<
 *                 try:
 *                     server.bind((self.host, self.port))
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L19_for_end;
    __pyx_L7_break:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L19_for_end;
    __pyx_L19_for_end:;

    /* "buelon/cython/c_hub.pyx":1011
 *                     if attempt == attempts:
 *                         raise
 *             server.listen()             # <<<<<<<<<<<<<<
 *             print(f"Server listening on {self.host}:{self.port}")
 * 
 */
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_listen); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1011, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1012
 *                         raise
 *             server.listen()
 *             print(f"Server listening on {self.host}:{self.port}")             # <<<<<<<<<<<<<<
 * 
 *             worker_thread = threading.Thread(target=self._process_transactions, daemon=True)
 */
    __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1012, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = 0;
    __pyx_t_15 = 127;
    __Pyx_INCREF(__pyx_kp_u_Server_listening_on);
    __pyx_t_7 += 20;
    __Pyx_GIVEREF(__pyx_kp_u_Server_listening_on);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Server_listening_on);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_host); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1012, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_12, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1012, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_15;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__39);
    __pyx_t_7 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__39);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__39);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_port); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1012, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1012, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_15;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_3, 4, __pyx_t_7, __pyx_t_15); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1012, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1012, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1014
 *             print(f"Server listening on {self.host}:{self.port}")
 * 
 *             worker_thread = threading.Thread(target=self._process_transactions, daemon=True)             # <<<<<<<<<<<<<<
 *             worker_thread.start()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Thread); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1014, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_process_transactions); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1014, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_target, __pyx_t_5) < 0) __PYX_ERR(0, 1014, __pyx_L4_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_daemon, Py_True) < 0) __PYX_ERR(0, 1014, __pyx_L4_error)
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1014, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_worker_thread = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1015
 * 
 *             worker_thread = threading.Thread(target=self._process_transactions, daemon=True)
 *             worker_thread.start()             # <<<<<<<<<<<<<<
 * 
 *             executor_thread = threading.Thread(target=self._execute_transaction, daemon=True)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_worker_thread, __pyx_n_s_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_12 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1015, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1017
 *             worker_thread.start()
 * 
 *             executor_thread = threading.Thread(target=self._execute_transaction, daemon=True)             # <<<<<<<<<<<<<<
 *             executor_thread.start()
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_threading); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1017, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Thread); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1017, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1017, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_transaction); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1017, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_target, __pyx_t_12) < 0) __PYX_ERR(0, 1017, __pyx_L4_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_daemon, Py_True) < 0) __PYX_ERR(0, 1017, __pyx_L4_error)
    __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1017, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_executor_thread = __pyx_t_12;
    __pyx_t_12 = 0;

    /* "buelon/cython/c_hub.pyx":1018
 * 
 *             executor_thread = threading.Thread(target=self._execute_transaction, daemon=True)
 *             executor_thread.start()             # <<<<<<<<<<<<<<
 * 
 *             while True:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_executor_thread, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1018, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1018, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "buelon/cython/c_hub.pyx":1020
 *             executor_thread.start()
 * 
 *             while True:             # <<<<<<<<<<<<<<
 *                 client_socket, addr = server.accept()
 *                 client_thread = threading.Thread(target=self._handle_client, args=(client_socket,), daemon=True)
 */
    while (1) {

      /* "buelon/cython/c_hub.pyx":1021
 * 
 *             while True:
 *                 client_socket, addr = server.accept()             # <<<<<<<<<<<<<<
 *                 client_thread = threading.Thread(target=self._handle_client, args=(client_socket,), daemon=True)
 *                 client_thread.start()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_accept); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1021, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1021, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) {
        PyObject* sequence = __pyx_t_12;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1021, __pyx_L4_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1021, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1021, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_1 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1021, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_19 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1);
        index = 0; __pyx_t_5 = __pyx_t_19(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L22_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_3 = __pyx_t_19(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L22_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_3);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_1), 2) < 0) __PYX_ERR(0, 1021, __pyx_L4_error)
        __pyx_t_19 = NULL;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L23_unpacking_done;
        __pyx_L22_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_19 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1021, __pyx_L4_error)
        __pyx_L23_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_client_socket, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_addr, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "buelon/cython/c_hub.pyx":1022
 *             while True:
 *                 client_socket, addr = server.accept()
 *                 client_thread = threading.Thread(target=self._handle_client, args=(client_socket,), daemon=True)             # <<<<<<<<<<<<<<
 *                 client_thread.start()
 *         finally:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_threading); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1022, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_Thread); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1022, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1022, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handle_client); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1022, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_target, __pyx_t_5) < 0) __PYX_ERR(0, 1022, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1022, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_client_socket);
      __Pyx_GIVEREF(__pyx_v_client_socket);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_client_socket)) __PYX_ERR(0, 1022, __pyx_L4_error);
      if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_args, __pyx_t_5) < 0) __PYX_ERR(0, 1022, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_daemon, Py_True) < 0) __PYX_ERR(0, 1022, __pyx_L4_error)
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1022, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF_SET(__pyx_v_client_thread, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "buelon/cython/c_hub.pyx":1023
 *                 client_socket, addr = server.accept()
 *                 client_thread = threading.Thread(target=self._handle_client, args=(client_socket,), daemon=True)
 *                 client_thread.start()             # <<<<<<<<<<<<<<
 *         finally:
 *             server.shutdown(socket.SHUT_RDWR)
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_client_thread, __pyx_n_s_start); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1023, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_3 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1023, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }

  /* "buelon/cython/c_hub.pyx":1025
 *                 client_thread.start()
 *         finally:
 *             server.shutdown(socket.SHUT_RDWR)             # <<<<<<<<<<<<<<
 *             server.close()
 *             exit()
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_shutdown); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1025, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1025, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SHUT_RDWR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_1};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1025, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "buelon/cython/c_hub.pyx":1026
 *         finally:
 *             server.shutdown(socket.SHUT_RDWR)
 *             server.close()             # <<<<<<<<<<<<<<
 *             exit()
 * 
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_close); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1026, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_1 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(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);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1026, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "buelon/cython/c_hub.pyx":1027
 *             server.shutdown(socket.SHUT_RDWR)
 *             server.close()
 *             exit()             # <<<<<<<<<<<<<<
 * 
 *     def _handle_client(self, client_socket):
 */
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_builtin_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1027, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 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;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_22);
      __Pyx_XGOTREF(__pyx_t_23);
      __Pyx_XGOTREF(__pyx_t_24);
      __pyx_t_13 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
      {

        /* "buelon/cython/c_hub.pyx":1025
 *                 client_thread.start()
 *         finally:
 *             server.shutdown(socket.SHUT_RDWR)             # <<<<<<<<<<<<<<
 *             server.close()
 *             exit()
 */
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_shutdown); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1025, __pyx_L25_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L25_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SHUT_RDWR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1025, __pyx_L25_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = NULL;
        __pyx_t_6 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(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);
            __pyx_t_6 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3};
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1025, __pyx_L25_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "buelon/cython/c_hub.pyx":1026
 *         finally:
 *             server.shutdown(socket.SHUT_RDWR)
 *             server.close()             # <<<<<<<<<<<<<<
 *             exit()
 * 
 */
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_close); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1026, __pyx_L25_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_3 = NULL;
        __pyx_t_6 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_6 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1026, __pyx_L25_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "buelon/cython/c_hub.pyx":1027
 *             server.shutdown(socket.SHUT_RDWR)
 *             server.close()
 *             exit()             # <<<<<<<<<<<<<<
 * 
 *     def _handle_client(self, client_socket):
 */
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_builtin_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1027, __pyx_L25_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_22);
        __Pyx_XGIVEREF(__pyx_t_23);
        __Pyx_XGIVEREF(__pyx_t_24);
        __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
      }
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ErrRestore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
      __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21;
      goto __pyx_L1_error;
      __pyx_L25_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_22);
        __Pyx_XGIVEREF(__pyx_t_23);
        __Pyx_XGIVEREF(__pyx_t_24);
        __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
      }
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "buelon/cython/c_hub.pyx":998
 *         return self.db_pool.submit(db_operation).result()
 * 
 *     def start(self):             # <<<<<<<<<<<<<<
 *         server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 *         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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_server);
  __Pyx_XDECREF(__pyx_v_attempts);
  __Pyx_XDECREF(__pyx_v_attempt);
  __Pyx_XDECREF(__pyx_v_worker_thread);
  __Pyx_XDECREF(__pyx_v_executor_thread);
  __Pyx_XDECREF(__pyx_v_client_socket);
  __Pyx_XDECREF(__pyx_v_addr);
  __Pyx_XDECREF(__pyx_v_client_thread);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1029
 *             exit()
 * 
 *     def _handle_client(self, client_socket):             # <<<<<<<<<<<<<<
 *         data = receive(client_socket)
 * 
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_8_handle_client(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_client_socket) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_method = NULL;
  PyObject *__pyx_v_payload = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_handle_client", 1);

  /* "buelon/cython/c_hub.pyx":1030
 * 
 *     def _handle_client(self, client_socket):
 *         data = receive(client_socket)             # <<<<<<<<<<<<<<
 * 
 *         if not data:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_receive); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_client_socket};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1032
 *         data = receive(client_socket)
 * 
 *         if not data:             # <<<<<<<<<<<<<<
 *             client_socket.close()
 *             return
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_data); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1032, __pyx_L1_error)
  __pyx_t_6 = (!__pyx_t_5);
  if (__pyx_t_6) {

    /* "buelon/cython/c_hub.pyx":1033
 * 
 *         if not data:
 *             client_socket.close()             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_client_socket, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __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;

    /* "buelon/cython/c_hub.pyx":1034
 *         if not data:
 *             client_socket.close()
 *             return             # <<<<<<<<<<<<<<
 * 
 *         method, payload = data.split(PIPELINE_SPLIT_TOKEN)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1032
 *         data = receive(client_socket)
 * 
 *         if not data:             # <<<<<<<<<<<<<<
 *             client_socket.close()
 *             return
 */
  }

  /* "buelon/cython/c_hub.pyx":1036
 *             return
 * 
 *         method, payload = data.split(PIPELINE_SPLIT_TOKEN)             # <<<<<<<<<<<<<<
 *         print('received', method)
 *         method = Method(method.decode())
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PIPELINE_SPLIT_TOKEN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1036, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
    index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1036, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_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, 1036, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_method = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_payload = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":1037
 * 
 *         method, payload = data.split(PIPELINE_SPLIT_TOKEN)
 *         print('received', method)             # <<<<<<<<<<<<<<
 *         method = Method(method.decode())
 *         self.transaction_queue.put((method, payload, client_socket))
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_received);
  __Pyx_GIVEREF(__pyx_n_s_received);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_received)) __PYX_ERR(0, 1037, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_method);
  __Pyx_GIVEREF(__pyx_v_method);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_method)) __PYX_ERR(0, 1037, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __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;

  /* "buelon/cython/c_hub.pyx":1038
 *         method, payload = data.split(PIPELINE_SPLIT_TOKEN)
 *         print('received', method)
 *         method = Method(method.decode())             # <<<<<<<<<<<<<<
 *         self.transaction_queue.put((method, payload, client_socket))
 *         # with client_socket:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_method, __pyx_n_s_decode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_7 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF_SET(__pyx_v_method, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":1039
 *         print('received', method)
 *         method = Method(method.decode())
 *         self.transaction_queue.put((method, payload, client_socket))             # <<<<<<<<<<<<<<
 *         # with client_socket:
 *         #     try:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transaction_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_put); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_method);
  __Pyx_GIVEREF(__pyx_v_method);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_method)) __PYX_ERR(0, 1039, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_payload);
  __Pyx_GIVEREF(__pyx_v_payload);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_payload)) __PYX_ERR(0, 1039, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_client_socket);
  __Pyx_GIVEREF(__pyx_v_client_socket);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_client_socket)) __PYX_ERR(0, 1039, __pyx_L1_error);
  __pyx_t_7 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_1};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":1029
 *             exit()
 * 
 *     def _handle_client(self, client_socket):             # <<<<<<<<<<<<<<
 *         data = receive(client_socket)
 * 
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer._handle_client", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_method);
  __Pyx_XDECREF(__pyx_v_payload);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1058
 *         #         traceback.print_exc()
 * 
 *     def _process_transactions(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             method, payload, client_socket = self.transaction_queue.get()
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_10_process_transactions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_method = NULL;
  PyObject *__pyx_v_payload = NULL;
  PyObject *__pyx_v_client_socket = NULL;
  PyObject *__pyx_v_response = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  char const *__pyx_t_21;
  PyObject *__pyx_t_22 = NULL;
  char const *__pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_process_transactions", 1);

  /* "buelon/cython/c_hub.pyx":1059
 * 
 *     def _process_transactions(self):
 *         while True:             # <<<<<<<<<<<<<<
 *             method, payload, client_socket = self.transaction_queue.get()
 *             try:
 */
  while (1) {

    /* "buelon/cython/c_hub.pyx":1060
 *     def _process_transactions(self):
 *         while True:
 *             method, payload, client_socket = self.transaction_queue.get()             # <<<<<<<<<<<<<<
 *             try:
 *                 with client_socket:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transaction_queue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1060, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1060, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1060, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1060, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1060, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1060, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1060, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
      index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 1060, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1060, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_method, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_payload, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_client_socket, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1061
 *         while True:
 *             method, payload, client_socket = self.transaction_queue.get()
 *             try:             # <<<<<<<<<<<<<<
 *                 with client_socket:
 *                     print('processing', method)
 */
    /*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:*/ {

          /* "buelon/cython/c_hub.pyx":1062
 *             method, payload, client_socket = self.transaction_queue.get()
 *             try:
 *                 with client_socket:             # <<<<<<<<<<<<<<
 *                     print('processing', method)
 *                     response = self._process_request(method, payload)
 */
          /*with:*/ {
            __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_v_client_socket, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1062, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_v_client_socket, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1062, __pyx_L20_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_2 = NULL;
            __pyx_t_4 = 0;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_5))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_5, function);
                __pyx_t_4 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1062, __pyx_L20_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
                __Pyx_XGOTREF(__pyx_t_12);
                __Pyx_XGOTREF(__pyx_t_13);
                __Pyx_XGOTREF(__pyx_t_14);
                /*try:*/ {

                  /* "buelon/cython/c_hub.pyx":1063
 *             try:
 *                 with client_socket:
 *                     print('processing', method)             # <<<<<<<<<<<<<<
 *                     response = self._process_request(method, payload)
 * 
 */
                  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L26_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_INCREF(__pyx_n_s_processing);
                  __Pyx_GIVEREF(__pyx_n_s_processing);
                  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_processing)) __PYX_ERR(0, 1063, __pyx_L26_error);
                  __Pyx_INCREF(__pyx_v_method);
                  __Pyx_GIVEREF(__pyx_v_method);
                  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_method)) __PYX_ERR(0, 1063, __pyx_L26_error);
                  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1063, __pyx_L26_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                  /* "buelon/cython/c_hub.pyx":1064
 *                 with client_socket:
 *                     print('processing', method)
 *                     response = self._process_request(method, payload)             # <<<<<<<<<<<<<<
 * 
 *                     send(client_socket, response)
 */
                  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_process_request); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __pyx_L26_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __pyx_t_2 = NULL;
                  __pyx_t_4 = 0;
                  #if CYTHON_UNPACK_METHODS
                  if (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);
                      __pyx_t_4 = 1;
                    }
                  }
                  #endif
                  {
                    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_method, __pyx_v_payload};
                    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
                    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1064, __pyx_L26_error)
                    __Pyx_GOTREF(__pyx_t_5);
                    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  }
                  __Pyx_XDECREF_SET(__pyx_v_response, __pyx_t_5);
                  __pyx_t_5 = 0;

                  /* "buelon/cython/c_hub.pyx":1066
 *                     response = self._process_request(method, payload)
 * 
 *                     send(client_socket, response)             # <<<<<<<<<<<<<<
 *             except KeyboardInterrupt:
 *                 raise
 */
                  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_send); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L26_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __pyx_t_2 = NULL;
                  __pyx_t_4 = 0;
                  #if CYTHON_UNPACK_METHODS
                  if (unlikely(PyMethod_Check(__pyx_t_1))) {
                    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
                    if (likely(__pyx_t_2)) {
                      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                      __Pyx_INCREF(__pyx_t_2);
                      __Pyx_INCREF(function);
                      __Pyx_DECREF_SET(__pyx_t_1, function);
                      __pyx_t_4 = 1;
                    }
                  }
                  #endif
                  {
                    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_client_socket, __pyx_v_response};
                    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
                    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1066, __pyx_L26_error)
                    __Pyx_GOTREF(__pyx_t_5);
                    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  }
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                  /* "buelon/cython/c_hub.pyx":1062
 *             method, payload, client_socket = self.transaction_queue.get()
 *             try:
 *                 with client_socket:             # <<<<<<<<<<<<<<
 *                     print('processing', method)
 *                     response = self._process_request(method, payload)
 */
                }
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                goto __pyx_L33_try_end;
                __pyx_L26_error:;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer._process_transactions", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 1062, __pyx_L28_except_error)
                  __Pyx_XGOTREF(__pyx_t_5);
                  __Pyx_XGOTREF(__pyx_t_1);
                  __Pyx_XGOTREF(__pyx_t_2);
                  __pyx_t_3 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L28_except_error)
                  __Pyx_GOTREF(__pyx_t_3);
                  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, NULL);
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1062, __pyx_L28_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, 1062, __pyx_L28_except_error)
                  __pyx_t_17 = (!__pyx_t_16);
                  if (unlikely(__pyx_t_17)) {
                    __Pyx_GIVEREF(__pyx_t_5);
                    __Pyx_GIVEREF(__pyx_t_1);
                    __Pyx_XGIVEREF(__pyx_t_2);
                    __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_1, __pyx_t_2);
                    __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_2 = 0; 
                    __PYX_ERR(0, 1062, __pyx_L28_except_error)
                  }
                  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  goto __pyx_L27_exception_handled;
                }
                __pyx_L28_except_error:;
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_XGIVEREF(__pyx_t_14);
                __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
                goto __pyx_L12_error;
                __pyx_L27_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_XGIVEREF(__pyx_t_14);
                __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
                __pyx_L33_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_11) {
                  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__5, NULL);
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1062, __pyx_L12_error)
                  __Pyx_GOTREF(__pyx_t_14);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                }
                goto __pyx_L25;
              }
              __pyx_L25:;
            }
            goto __pyx_L37;
            __pyx_L20_error:;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            goto __pyx_L12_error;
            __pyx_L37:;
          }

          /* "buelon/cython/c_hub.pyx":1061
 *         while True:
 *             method, payload, client_socket = self.transaction_queue.get()
 *             try:             # <<<<<<<<<<<<<<
 *                 with client_socket:
 *                     print('processing', method)
 */
        }
        __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_L19_try_end;
        __pyx_L12_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "buelon/cython/c_hub.pyx":1067
 * 
 *                     send(client_socket, response)
 *             except KeyboardInterrupt:             # <<<<<<<<<<<<<<
 *                 raise
 *             except Exception as e:
 */
        __pyx_t_18 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyboardInterrupt);
        if (__pyx_t_18) {
          __Pyx_AddTraceback("buelon.cython.c_hub.HubServer._process_transactions", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_5) < 0) __PYX_ERR(0, 1067, __pyx_L14_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_5);

          /* "buelon/cython/c_hub.pyx":1068
 *                     send(client_socket, response)
 *             except KeyboardInterrupt:
 *                 raise             # <<<<<<<<<<<<<<
 *             except Exception as e:
 *                 traceback.print_exc()
 */
          __Pyx_GIVEREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_1);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_5);
          __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_5 = 0; 
          __PYX_ERR(0, 1068, __pyx_L14_except_error)
        }

        /* "buelon/cython/c_hub.pyx":1069
 *             except KeyboardInterrupt:
 *                 raise
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 traceback.print_exc()
 *                 print(f"Error processing transaction: {e}")
 */
        __pyx_t_18 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
        if (__pyx_t_18) {
          __Pyx_AddTraceback("buelon.cython.c_hub.HubServer._process_transactions", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 1069, __pyx_L14_except_error)
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __pyx_v_e = __pyx_t_1;
          /*try:*/ {

            /* "buelon/cython/c_hub.pyx":1070
 *                 raise
 *             except Exception as e:
 *                 traceback.print_exc()             # <<<<<<<<<<<<<<
 *                 print(f"Error processing transaction: {e}")
 *             finally:
 */
            __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_traceback); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1070, __pyx_L45_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_print_exc); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1070, __pyx_L45_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_6 = NULL;
            __pyx_t_4 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_19))) {
              __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_19);
              if (likely(__pyx_t_6)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
                __Pyx_INCREF(__pyx_t_6);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_19, function);
                __pyx_t_4 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
              __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1070, __pyx_L45_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "buelon/cython/c_hub.pyx":1071
 *             except Exception as e:
 *                 traceback.print_exc()
 *                 print(f"Error processing transaction: {e}")             # <<<<<<<<<<<<<<
 *             finally:
 *                 self.transaction_queue.task_done()
 */
            __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_e, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L45_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_19 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Error_processing_transaction, __pyx_t_3); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1071, __pyx_L45_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L45_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }

          /* "buelon/cython/c_hub.pyx":1069
 *             except KeyboardInterrupt:
 *                 raise
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 traceback.print_exc()
 *                 print(f"Error processing transaction: {e}")
 */
          /*finally:*/ {
            /*normal exit:*/{
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              goto __pyx_L46;
            }
            __pyx_L45_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_11 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_15 = 0; __pyx_t_22 = 0;
              __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_15, &__pyx_t_22);
              if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_14, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_14, &__pyx_t_13);
              __Pyx_XGOTREF(__pyx_t_11);
              __Pyx_XGOTREF(__pyx_t_14);
              __Pyx_XGOTREF(__pyx_t_13);
              __Pyx_XGOTREF(__pyx_t_12);
              __Pyx_XGOTREF(__pyx_t_15);
              __Pyx_XGOTREF(__pyx_t_22);
              __pyx_t_18 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              }
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_15);
                __Pyx_XGIVEREF(__pyx_t_22);
                __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_15, __pyx_t_22);
              }
              __Pyx_XGIVEREF(__pyx_t_11);
              __Pyx_XGIVEREF(__pyx_t_14);
              __Pyx_XGIVEREF(__pyx_t_13);
              __Pyx_ErrRestore(__pyx_t_11, __pyx_t_14, __pyx_t_13);
              __pyx_t_11 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_15 = 0; __pyx_t_22 = 0;
              __pyx_lineno = __pyx_t_18; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21;
              goto __pyx_L14_except_error;
            }
            __pyx_L46:;
          }
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L13_exception_handled;
        }
        goto __pyx_L14_except_error;

        /* "buelon/cython/c_hub.pyx":1061
 *         while True:
 *             method, payload, client_socket = self.transaction_queue.get()
 *             try:             # <<<<<<<<<<<<<<
 *                 with client_socket:
 *                     print('processing', method)
 */
        __pyx_L14_except_error:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L10_error;
        __pyx_L13_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L19_try_end:;
      }
    }

    /* "buelon/cython/c_hub.pyx":1073
 *                 print(f"Error processing transaction: {e}")
 *             finally:
 *                 self.transaction_queue.task_done()             # <<<<<<<<<<<<<<
 * 
 *     # def _execute_transaction(self):
 */
    /*finally:*/ {
      /*normal exit:*/{
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transaction_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_task_done); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1073, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L11;
      }
      __pyx_L10_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_22 = 0; __pyx_t_15 = 0; __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_15, &__pyx_t_12);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_22);
        __Pyx_XGOTREF(__pyx_t_15);
        __Pyx_XGOTREF(__pyx_t_12);
        __pyx_t_20 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
        {
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_transaction_queue); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1073, __pyx_L54_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_task_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L54_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = NULL;
          __pyx_t_4 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_5)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_4 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L54_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_15, __pyx_t_12);
        }
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ErrRestore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_22 = 0; __pyx_t_15 = 0; __pyx_t_12 = 0;
        __pyx_lineno = __pyx_t_20; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_23;
        goto __pyx_L1_error;
        __pyx_L54_error:;
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_15, __pyx_t_12);
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_22 = 0; __pyx_t_15 = 0; __pyx_t_12 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L11:;
    }
  }

  /* "buelon/cython/c_hub.pyx":1058
 *         #         traceback.print_exc()
 * 
 *     def _process_transactions(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             method, payload, client_socket = self.transaction_queue.get()
 */

  /* 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_19);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer._process_transactions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_method);
  __Pyx_XDECREF(__pyx_v_payload);
  __Pyx_XDECREF(__pyx_v_client_socket);
  __Pyx_XDECREF(__pyx_v_response);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1089
 *     #             self.execution_queue.task_done()
 * 
 *     def _execute_transaction(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             method, payload = self.execution_queue.get()
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_12_execute_transaction(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_method = NULL;
  PyObject *__pyx_v_payload = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  char const *__pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_execute_transaction", 1);

  /* "buelon/cython/c_hub.pyx":1090
 * 
 *     def _execute_transaction(self):
 *         while True:             # <<<<<<<<<<<<<<
 *             method, payload = self.execution_queue.get()
 *             try:
 */
  while (1) {

    /* "buelon/cython/c_hub.pyx":1091
 *     def _execute_transaction(self):
 *         while True:
 *             method, payload = self.execution_queue.get()             # <<<<<<<<<<<<<<
 *             try:
 *                 print('executing', method)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execution_queue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1091, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1091, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1091, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1091, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1091, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 1091, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1091, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_method, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_payload, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "buelon/cython/c_hub.pyx":1092
 *         while True:
 *             method, payload = self.execution_queue.get()
 *             try:             # <<<<<<<<<<<<<<
 *                 print('executing', method)
 *                 self._execute_request(method, payload)
 */
    /*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:*/ {

          /* "buelon/cython/c_hub.pyx":1093
 *             method, payload = self.execution_queue.get()
 *             try:
 *                 print('executing', method)             # <<<<<<<<<<<<<<
 *                 self._execute_request(method, payload)
 *             except KeyboardInterrupt:
 */
          __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_n_s_executing);
          __Pyx_GIVEREF(__pyx_n_s_executing);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_executing)) __PYX_ERR(0, 1093, __pyx_L12_error);
          __Pyx_INCREF(__pyx_v_method);
          __Pyx_GIVEREF(__pyx_v_method);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_method)) __PYX_ERR(0, 1093, __pyx_L12_error);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1093, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":1094
 *             try:
 *                 print('executing', method)
 *                 self._execute_request(method, payload)             # <<<<<<<<<<<<<<
 *             except KeyboardInterrupt:
 *                 raise
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_request); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1094, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          __pyx_t_4 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_4 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_payload};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "buelon/cython/c_hub.pyx":1092
 *         while True:
 *             method, payload = self.execution_queue.get()
 *             try:             # <<<<<<<<<<<<<<
 *                 print('executing', method)
 *                 self._execute_request(method, payload)
 */
        }
        __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_L19_try_end;
        __pyx_L12_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "buelon/cython/c_hub.pyx":1095
 *                 print('executing', method)
 *                 self._execute_request(method, payload)
 *             except KeyboardInterrupt:             # <<<<<<<<<<<<<<
 *                 raise
 *             except Exception as e:
 */
        __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyboardInterrupt);
        if (__pyx_t_10) {
          __Pyx_AddTraceback("buelon.cython.c_hub.HubServer._execute_transaction", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 1095, __pyx_L14_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_3);

          /* "buelon/cython/c_hub.pyx":1096
 *                 self._execute_request(method, payload)
 *             except KeyboardInterrupt:
 *                 raise             # <<<<<<<<<<<<<<
 *             except Exception as e:
 *                 traceback.print_exc()
 */
          __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, 1096, __pyx_L14_except_error)
        }

        /* "buelon/cython/c_hub.pyx":1097
 *             except KeyboardInterrupt:
 *                 raise
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 traceback.print_exc()
 *                 print(f"Error processing transaction: {e}")
 */
        __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
        if (__pyx_t_10) {
          __Pyx_AddTraceback("buelon.cython.c_hub.HubServer._execute_transaction", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 1097, __pyx_L14_except_error)
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __pyx_v_e = __pyx_t_1;
          /*try:*/ {

            /* "buelon/cython/c_hub.pyx":1098
 *                 raise
 *             except Exception as e:
 *                 traceback.print_exc()             # <<<<<<<<<<<<<<
 *                 print(f"Error processing transaction: {e}")
 *             finally:
 */
            __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_traceback); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1098, __pyx_L27_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_print_exc); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1098, __pyx_L27_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = NULL;
            __pyx_t_4 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_12))) {
              __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
              if (likely(__pyx_t_11)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
                __Pyx_INCREF(__pyx_t_11);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_12, function);
                __pyx_t_4 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
              __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1098, __pyx_L27_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            }
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "buelon/cython/c_hub.pyx":1099
 *             except Exception as e:
 *                 traceback.print_exc()
 *                 print(f"Error processing transaction: {e}")             # <<<<<<<<<<<<<<
 *             finally:
 *                 self.execution_queue.task_done()
 */
            __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_e, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1099, __pyx_L27_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Error_processing_transaction, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1099, __pyx_L27_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1099, __pyx_L27_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }

          /* "buelon/cython/c_hub.pyx":1097
 *             except KeyboardInterrupt:
 *                 raise
 *             except Exception as e:             # <<<<<<<<<<<<<<
 *                 traceback.print_exc()
 *                 print(f"Error processing transaction: {e}")
 */
          /*finally:*/ {
            /*normal exit:*/{
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              goto __pyx_L28;
            }
            __pyx_L27_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
              if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
              __Pyx_XGOTREF(__pyx_t_15);
              __Pyx_XGOTREF(__pyx_t_16);
              __Pyx_XGOTREF(__pyx_t_17);
              __Pyx_XGOTREF(__pyx_t_18);
              __Pyx_XGOTREF(__pyx_t_19);
              __Pyx_XGOTREF(__pyx_t_20);
              __pyx_t_10 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              }
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_18);
                __Pyx_XGIVEREF(__pyx_t_19);
                __Pyx_XGIVEREF(__pyx_t_20);
                __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
              }
              __Pyx_XGIVEREF(__pyx_t_15);
              __Pyx_XGIVEREF(__pyx_t_16);
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
              __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
              __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
              goto __pyx_L14_except_error;
            }
            __pyx_L28:;
          }
          __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;
          goto __pyx_L13_exception_handled;
        }
        goto __pyx_L14_except_error;

        /* "buelon/cython/c_hub.pyx":1092
 *         while True:
 *             method, payload = self.execution_queue.get()
 *             try:             # <<<<<<<<<<<<<<
 *                 print('executing', method)
 *                 self._execute_request(method, payload)
 */
        __pyx_L14_except_error:;
        __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_L10_error;
        __pyx_L13_exception_handled:;
        __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_L19_try_end:;
      }
    }

    /* "buelon/cython/c_hub.pyx":1101
 *                 print(f"Error processing transaction: {e}")
 *             finally:
 *                 self.execution_queue.task_done()             # <<<<<<<<<<<<<<
 * 
 *     def _execute_request(self, method, payload):
 */
    /*finally:*/ {
      /*normal exit:*/{
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execution_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_task_done); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1101, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __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;
        goto __pyx_L11;
      }
      __pyx_L10_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_20);
        __Pyx_XGOTREF(__pyx_t_19);
        __Pyx_XGOTREF(__pyx_t_18);
        __pyx_t_13 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
        {
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execution_queue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1101, __pyx_L36_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_task_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L36_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          __pyx_t_4 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_4 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
            __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __pyx_L36_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
        }
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ErrRestore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
        __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_21;
        goto __pyx_L1_error;
        __pyx_L36_error:;
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L11:;
    }
  }

  /* "buelon/cython/c_hub.pyx":1089
 *     #             self.execution_queue.task_done()
 * 
 *     def _execute_transaction(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             method, payload = self.execution_queue.get()
 */

  /* 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_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer._execute_transaction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_method);
  __Pyx_XDECREF(__pyx_v_payload);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1103
 *                 self.execution_queue.task_done()
 * 
 *     def _execute_request(self, method, payload):             # <<<<<<<<<<<<<<
 *         if method == Method.DONE:
 *             # _done(payload.decode())
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_14_execute_request(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_payload) {
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_step_json = NULL;
  PyObject *__pyx_v_status_value = NULL;
  PyObject *__pyx_v_step_jsons = NULL;
  PyObject *__pyx_v_status_values = 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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_execute_request", 1);

  /* "buelon/cython/c_hub.pyx":1104
 * 
 *     def _execute_request(self, method, payload):
 *         if method == Method.DONE:             # <<<<<<<<<<<<<<
 *             # _done(payload.decode())
 *             _done(self, payload.decode())
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_method, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "buelon/cython/c_hub.pyx":1106
 *         if method == Method.DONE:
 *             # _done(payload.decode())
 *             _done(self, payload.decode())             # <<<<<<<<<<<<<<
 *             return
 *         elif method == Method.PENDING:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_done); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_payload, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1106, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_self, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1106, __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;

    /* "buelon/cython/c_hub.pyx":1107
 *             # _done(payload.decode())
 *             _done(self, payload.decode())
 *             return             # <<<<<<<<<<<<<<
 *         elif method == Method.PENDING:
 *             _pending(self, payload.decode())
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1104
 * 
 *     def _execute_request(self, method, payload):
 *         if method == Method.DONE:             # <<<<<<<<<<<<<<
 *             # _done(payload.decode())
 *             _done(self, payload.decode())
 */
  }

  /* "buelon/cython/c_hub.pyx":1108
 *             _done(self, payload.decode())
 *             return
 *         elif method == Method.PENDING:             # <<<<<<<<<<<<<<
 *             _pending(self, payload.decode())
 *             return
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PENDING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_method, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "buelon/cython/c_hub.pyx":1109
 *             return
 *         elif method == Method.PENDING:
 *             _pending(self, payload.decode())             # <<<<<<<<<<<<<<
 *             return
 *         elif method == Method.CANCEL:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pending_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_payload, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_self, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(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;

    /* "buelon/cython/c_hub.pyx":1110
 *         elif method == Method.PENDING:
 *             _pending(self, payload.decode())
 *             return             # <<<<<<<<<<<<<<
 *         elif method == Method.CANCEL:
 *             _cancel(self, payload.decode())
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1108
 *             _done(self, payload.decode())
 *             return
 *         elif method == Method.PENDING:             # <<<<<<<<<<<<<<
 *             _pending(self, payload.decode())
 *             return
 */
  }

  /* "buelon/cython/c_hub.pyx":1111
 *             _pending(self, payload.decode())
 *             return
 *         elif method == Method.CANCEL:             # <<<<<<<<<<<<<<
 *             _cancel(self, payload.decode())
 *             return
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CANCEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_method, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "buelon/cython/c_hub.pyx":1112
 *             return
 *         elif method == Method.CANCEL:
 *             _cancel(self, payload.decode())             # <<<<<<<<<<<<<<
 *             return
 *         elif method == Method.RESET:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cancel_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_payload, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_self, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __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;

    /* "buelon/cython/c_hub.pyx":1113
 *         elif method == Method.CANCEL:
 *             _cancel(self, payload.decode())
 *             return             # <<<<<<<<<<<<<<
 *         elif method == Method.RESET:
 *             _reset(self, payload.decode())
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1111
 *             _pending(self, payload.decode())
 *             return
 *         elif method == Method.CANCEL:             # <<<<<<<<<<<<<<
 *             _cancel(self, payload.decode())
 *             return
 */
  }

  /* "buelon/cython/c_hub.pyx":1114
 *             _cancel(self, payload.decode())
 *             return
 *         elif method == Method.RESET:             # <<<<<<<<<<<<<<
 *             _reset(self, payload.decode())
 *             return
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_RESET); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_method, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "buelon/cython/c_hub.pyx":1115
 *             return
 *         elif method == Method.RESET:
 *             _reset(self, payload.decode())             # <<<<<<<<<<<<<<
 *             return
 *         elif method == Method.ERROR:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_reset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_payload, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_self, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __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;

    /* "buelon/cython/c_hub.pyx":1116
 *         elif method == Method.RESET:
 *             _reset(self, payload.decode())
 *             return             # <<<<<<<<<<<<<<
 *         elif method == Method.ERROR:
 *             values = buelon.helpers.json_parser.loads(payload)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1114
 *             _cancel(self, payload.decode())
 *             return
 *         elif method == Method.RESET:             # <<<<<<<<<<<<<<
 *             _reset(self, payload.decode())
 *             return
 */
  }

  /* "buelon/cython/c_hub.pyx":1117
 *             _reset(self, payload.decode())
 *             return
 *         elif method == Method.ERROR:             # <<<<<<<<<<<<<<
 *             values = buelon.helpers.json_parser.loads(payload)
 *             _error(self, values['step_id'], values['msg'], values['trace'])
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_method, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "buelon/cython/c_hub.pyx":1118
 *             return
 *         elif method == Method.ERROR:
 *             values = buelon.helpers.json_parser.loads(payload)             # <<<<<<<<<<<<<<
 *             _error(self, values['step_id'], values['msg'], values['trace'])
 *             return
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_helpers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_loads); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_payload};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_v_values = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1119
 *         elif method == Method.ERROR:
 *             values = buelon.helpers.json_parser.loads(payload)
 *             _error(self, values['step_id'], values['msg'], values['trace'])             # <<<<<<<<<<<<<<
 *             return
 *         elif method == Method.UPLOAD_STEP:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_values, __pyx_n_s_step_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_values, __pyx_n_s_msg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_values, __pyx_n_s_trace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_v_self, __pyx_t_2, __pyx_t_5, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1119, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1120
 *             values = buelon.helpers.json_parser.loads(payload)
 *             _error(self, values['step_id'], values['msg'], values['trace'])
 *             return             # <<<<<<<<<<<<<<
 *         elif method == Method.UPLOAD_STEP:
 *             step_json, status_value = buelon.helpers.json_parser.loads(payload)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1117
 *             _reset(self, payload.decode())
 *             return
 *         elif method == Method.ERROR:             # <<<<<<<<<<<<<<
 *             values = buelon.helpers.json_parser.loads(payload)
 *             _error(self, values['step_id'], values['msg'], values['trace'])
 */
  }

  /* "buelon/cython/c_hub.pyx":1121
 *             _error(self, values['step_id'], values['msg'], values['trace'])
 *             return
 *         elif method == Method.UPLOAD_STEP:             # <<<<<<<<<<<<<<
 *             step_json, status_value = buelon.helpers.json_parser.loads(payload)
 *             # _upload_step(step_json, status_value)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_UPLOAD_STEP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_method, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1121, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "buelon/cython/c_hub.pyx":1122
 *             return
 *         elif method == Method.UPLOAD_STEP:
 *             step_json, status_value = buelon.helpers.json_parser.loads(payload)             # <<<<<<<<<<<<<<
 *             # _upload_step(step_json, status_value)
 *             _upload_step(self, step_json, status_value)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_buelon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_loads); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_payload};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1122, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_5), 2) < 0) __PYX_ERR(0, 1122, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1122, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_step_json = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_v_status_value = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1124
 *             step_json, status_value = buelon.helpers.json_parser.loads(payload)
 *             # _upload_step(step_json, status_value)
 *             _upload_step(self, step_json, status_value)             # <<<<<<<<<<<<<<
 *             return
 *         elif method == Method.UPLOAD_STEPS:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_upload_step_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_self, __pyx_v_step_json, __pyx_v_status_value};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1125
 *             # _upload_step(step_json, status_value)
 *             _upload_step(self, step_json, status_value)
 *             return             # <<<<<<<<<<<<<<
 *         elif method == Method.UPLOAD_STEPS:
 *             step_jsons, status_values = buelon.helpers.json_parser.loads(payload)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1121
 *             _error(self, values['step_id'], values['msg'], values['trace'])
 *             return
 *         elif method == Method.UPLOAD_STEP:             # <<<<<<<<<<<<<<
 *             step_json, status_value = buelon.helpers.json_parser.loads(payload)
 *             # _upload_step(step_json, status_value)
 */
  }

  /* "buelon/cython/c_hub.pyx":1126
 *             _upload_step(self, step_json, status_value)
 *             return
 *         elif method == Method.UPLOAD_STEPS:             # <<<<<<<<<<<<<<
 *             step_jsons, status_values = buelon.helpers.json_parser.loads(payload)
 *             # _upload_steps(step_jsons, status_values)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_UPLOAD_STEPS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_method, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "buelon/cython/c_hub.pyx":1127
 *             return
 *         elif method == Method.UPLOAD_STEPS:
 *             step_jsons, status_values = buelon.helpers.json_parser.loads(payload)             # <<<<<<<<<<<<<<
 *             # _upload_steps(step_jsons, status_values)
 *             _upload_steps(self, step_jsons, status_values)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_buelon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_loads); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_payload};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1127, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1127, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1127, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1127, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1127, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_5), 2) < 0) __PYX_ERR(0, 1127, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1127, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __pyx_v_step_jsons = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_v_status_values = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1129
 *             step_jsons, status_values = buelon.helpers.json_parser.loads(payload)
 *             # _upload_steps(step_jsons, status_values)
 *             _upload_steps(self, step_jsons, status_values)             # <<<<<<<<<<<<<<
 *             # for step_json, status_value in zip(step_jsons, status_values):
 *             #     _upload_step(step_json, status_value)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_upload_steps_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_self, __pyx_v_step_jsons, __pyx_v_status_values};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1132
 *             # for step_json, status_value in zip(step_jsons, status_values):
 *             #     _upload_step(step_json, status_value)
 *             return             # <<<<<<<<<<<<<<
 *         elif method == Method.RESET_ERRORS:
 *             # _reset_errors(payload)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1126
 *             _upload_step(self, step_json, status_value)
 *             return
 *         elif method == Method.UPLOAD_STEPS:             # <<<<<<<<<<<<<<
 *             step_jsons, status_values = buelon.helpers.json_parser.loads(payload)
 *             # _upload_steps(step_jsons, status_values)
 */
  }

  /* "buelon/cython/c_hub.pyx":1133
 *             #     _upload_step(step_json, status_value)
 *             return
 *         elif method == Method.RESET_ERRORS:             # <<<<<<<<<<<<<<
 *             # _reset_errors(payload)
 *             _reset_errors(self, payload)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_RESET_ERRORS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_method, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "buelon/cython/c_hub.pyx":1135
 *         elif method == Method.RESET_ERRORS:
 *             # _reset_errors(payload)
 *             _reset_errors(self, payload)             # <<<<<<<<<<<<<<
 *             return
 *         # elif method == Method.DELETE_STEPS:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_reset_errors_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_self, __pyx_v_payload};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1136
 *             # _reset_errors(payload)
 *             _reset_errors(self, payload)
 *             return             # <<<<<<<<<<<<<<
 *         # elif method == Method.DELETE_STEPS:
 *         #     _delete_steps()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1133
 *             #     _upload_step(step_json, status_value)
 *             return
 *         elif method == Method.RESET_ERRORS:             # <<<<<<<<<<<<<<
 *             # _reset_errors(payload)
 *             _reset_errors(self, payload)
 */
  }

  /* "buelon/cython/c_hub.pyx":1140
 *         #     _delete_steps()
 *         #     return
 *         raise ValueError(f'Invalid method: {method}')             # <<<<<<<<<<<<<<
 * 
 *     def _process_request(self, method: Method, payload: bytes):
 */
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_method, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_method, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 1140, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1103
 *                 self.execution_queue.task_done()
 * 
 *     def _execute_request(self, method, payload):             # <<<<<<<<<<<<<<
 *         if method == Method.DONE:
 *             # _done(payload.decode())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer._execute_request", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_step_json);
  __Pyx_XDECREF(__pyx_v_status_value);
  __Pyx_XDECREF(__pyx_v_step_jsons);
  __Pyx_XDECREF(__pyx_v_status_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1142
 *         raise ValueError(f'Invalid method: {method}')
 * 
 *     def _process_request(self, method: Method, payload: bytes):             # <<<<<<<<<<<<<<
 *         if (method == Method.DONE or method == Method.PENDING or method == Method.CANCEL or method == Method.RESET
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubServer_17_process_request(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubServer_17_process_request = {"_process_request", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubServer_17_process_request, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubServer_17_process_request(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_payload = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_process_request (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_method,&__pyx_n_s_payload,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1142, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_method)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1142, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_process_request", 1, 3, 3, 1); __PYX_ERR(0, 1142, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_payload)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1142, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_process_request", 1, 3, 3, 2); __PYX_ERR(0, 1142, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_process_request") < 0)) __PYX_ERR(0, 1142, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_method = values[1];
    __pyx_v_payload = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_process_request", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1142, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer._process_request", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_payload), (&PyBytes_Type), 0, "payload", 1))) __PYX_ERR(0, 1142, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubServer_16_process_request(__pyx_self, __pyx_v_self, __pyx_v_method, __pyx_v_payload);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubServer_16_process_request_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1190
 * 
 *                 if isinstance(exclude, list):
 *                     if not all(isinstance(x, str) for x in exclude):             # <<<<<<<<<<<<<<
 *                         raise ValueError('exclude must be a list of strings')
 *             except ValueError:
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_16_process_request_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1190, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubServer_16_process_request_2generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubServer__process_request_local, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1190, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer._process_request.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_6buelon_6cython_5c_hub_9HubServer_16_process_request_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1190, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1190, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1190, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1190, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1190, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1190, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1190, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1190, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1190, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1190, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = PyString_Check(__pyx_cur_scope->__pyx_v_x); 
    __pyx_t_6 = (!__pyx_t_5);
    if (__pyx_t_6) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1142
 *         raise ValueError(f'Invalid method: {method}')
 * 
 *     def _process_request(self, method: Method, payload: bytes):             # <<<<<<<<<<<<<<
 *         if (method == Method.DONE or method == Method.PENDING or method == Method.CANCEL or method == Method.RESET
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_16_process_request(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_payload) {
  PyObject *__pyx_v_scopes = NULL;
  PyObject *__pyx_v_kwargs = NULL;
  PyObject *__pyx_v_steps = NULL;
  PyObject *__pyx_v_step_id = NULL;
  PyObject *__pyx_v_rows = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_config = NULL;
  PyObject *__pyx_v_count = NULL;
  PyObject *__pyx_v_exclude = NULL;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubServer_16_process_request_2generator5 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_process_request", 1);

  /* "buelon/cython/c_hub.pyx":1143
 * 
 *     def _process_request(self, method: Method, payload: bytes):
 *         if (method == Method.DONE or method == Method.PENDING or method == Method.CANCEL or method == Method.RESET             # <<<<<<<<<<<<<<
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS
 *                 or method == Method.RESET_ERRORS):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_DONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_method, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_PENDING); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_method, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_CANCEL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_method, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }

  /* "buelon/cython/c_hub.pyx":1144
 *     def _process_request(self, method: Method, payload: bytes):
 *         if (method == Method.DONE or method == Method.PENDING or method == Method.CANCEL or method == Method.RESET
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS             # <<<<<<<<<<<<<<
 *                 or method == Method.RESET_ERRORS):
 *             self.execution_queue.put((method, payload))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "buelon/cython/c_hub.pyx":1143
 * 
 *     def _process_request(self, method: Method, payload: bytes):
 *         if (method == Method.DONE or method == Method.PENDING or method == Method.CANCEL or method == Method.RESET             # <<<<<<<<<<<<<<
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS
 *                 or method == Method.RESET_ERRORS):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_RESET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_method, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }

  /* "buelon/cython/c_hub.pyx":1144
 *     def _process_request(self, method: Method, payload: bytes):
 *         if (method == Method.DONE or method == Method.PENDING or method == Method.CANCEL or method == Method.RESET
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS             # <<<<<<<<<<<<<<
 *                 or method == Method.RESET_ERRORS):
 *             self.execution_queue.put((method, payload))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ERROR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_method, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_UPLOAD_STEP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_method, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }

  /* "buelon/cython/c_hub.pyx":1145
 *         if (method == Method.DONE or method == Method.PENDING or method == Method.CANCEL or method == Method.RESET
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS
 *                 or method == Method.RESET_ERRORS):             # <<<<<<<<<<<<<<
 *             self.execution_queue.put((method, payload))
 *         if method == Method.GET_STEPS:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "buelon/cython/c_hub.pyx":1144
 *     def _process_request(self, method: Method, payload: bytes):
 *         if (method == Method.DONE or method == Method.PENDING or method == Method.CANCEL or method == Method.RESET
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS             # <<<<<<<<<<<<<<
 *                 or method == Method.RESET_ERRORS):
 *             self.execution_queue.put((method, payload))
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_UPLOAD_STEPS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_method, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }

  /* "buelon/cython/c_hub.pyx":1145
 *         if (method == Method.DONE or method == Method.PENDING or method == Method.CANCEL or method == Method.RESET
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS
 *                 or method == Method.RESET_ERRORS):             # <<<<<<<<<<<<<<
 *             self.execution_queue.put((method, payload))
 *         if method == Method.GET_STEPS:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_RESET_ERRORS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_method, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;

  /* "buelon/cython/c_hub.pyx":1143
 * 
 *     def _process_request(self, method: Method, payload: bytes):
 *         if (method == Method.DONE or method == Method.PENDING or method == Method.CANCEL or method == Method.RESET             # <<<<<<<<<<<<<<
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS
 *                 or method == Method.RESET_ERRORS):
 */
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1146
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS
 *                 or method == Method.RESET_ERRORS):
 *             self.execution_queue.put((method, payload))             # <<<<<<<<<<<<<<
 *         if method == Method.GET_STEPS:
 *             scopes, kwargs = buelon.helpers.json_parser.loads(payload)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execution_queue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_put); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_method);
    __Pyx_GIVEREF(__pyx_v_method);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_method)) __PYX_ERR(0, 1146, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_payload);
    __Pyx_GIVEREF(__pyx_v_payload);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_payload)) __PYX_ERR(0, 1146, __pyx_L1_error);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "buelon/cython/c_hub.pyx":1143
 * 
 *     def _process_request(self, method: Method, payload: bytes):
 *         if (method == Method.DONE or method == Method.PENDING or method == Method.CANCEL or method == Method.RESET             # <<<<<<<<<<<<<<
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS
 *                 or method == Method.RESET_ERRORS):
 */
  }

  /* "buelon/cython/c_hub.pyx":1147
 *                 or method == Method.RESET_ERRORS):
 *             self.execution_queue.put((method, payload))
 *         if method == Method.GET_STEPS:             # <<<<<<<<<<<<<<
 *             scopes, kwargs = buelon.helpers.json_parser.loads(payload)
 *             # steps = get_steps(scopes, **kwargs)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_GET_STEPS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_method, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1148
 *             self.execution_queue.put((method, payload))
 *         if method == Method.GET_STEPS:
 *             scopes, kwargs = buelon.helpers.json_parser.loads(payload)             # <<<<<<<<<<<<<<
 *             # steps = get_steps(scopes, **kwargs)
 *             steps = self.get_steps(scopes, **kwargs)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __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_json_parser); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_payload};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1148, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #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, 1148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1148, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L14_unpacking_done;
      __pyx_L13_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, 1148, __pyx_L1_error)
      __pyx_L14_unpacking_done:;
    }
    __pyx_v_scopes = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_kwargs = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1150
 *             scopes, kwargs = buelon.helpers.json_parser.loads(payload)
 *             # steps = get_steps(scopes, **kwargs)
 *             steps = self.get_steps(scopes, **kwargs)             # <<<<<<<<<<<<<<
 *             return buelon.helpers.json_parser.dumps(steps)
 *         elif method == Method.FETCH_ROWS:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_steps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_scopes);
    __Pyx_GIVEREF(__pyx_v_scopes);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_scopes)) __PYX_ERR(0, 1150, __pyx_L1_error);
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(0, 1150, __pyx_L1_error)
    }
    if (likely(PyDict_CheckExact(__pyx_v_kwargs))) {
      __pyx_t_3 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_steps = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "buelon/cython/c_hub.pyx":1151
 *             # steps = get_steps(scopes, **kwargs)
 *             steps = self.get_steps(scopes, **kwargs)
 *             return buelon.helpers.json_parser.dumps(steps)             # <<<<<<<<<<<<<<
 *         elif method == Method.FETCH_ROWS:
 *             step_id = buelon.helpers.json_parser.loads(payload)['step_id']
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_helpers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1151, __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_dumps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_steps};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1147
 *                 or method == Method.RESET_ERRORS):
 *             self.execution_queue.put((method, payload))
 *         if method == Method.GET_STEPS:             # <<<<<<<<<<<<<<
 *             scopes, kwargs = buelon.helpers.json_parser.loads(payload)
 *             # steps = get_steps(scopes, **kwargs)
 */
  }

  /* "buelon/cython/c_hub.pyx":1152
 *             steps = self.get_steps(scopes, **kwargs)
 *             return buelon.helpers.json_parser.dumps(steps)
 *         elif method == Method.FETCH_ROWS:             # <<<<<<<<<<<<<<
 *             step_id = buelon.helpers.json_parser.loads(payload)['step_id']
 *             rows = get_step_status(self, step_id)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Method); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_FETCH_ROWS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_RichCompare(__pyx_v_method, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1153
 *             return buelon.helpers.json_parser.dumps(steps)
 *         elif method == Method.FETCH_ROWS:
 *             step_id = buelon.helpers.json_parser.loads(payload)['step_id']             # <<<<<<<<<<<<<<
 *             rows = get_step_status(self, step_id)
 *             return buelon.helpers.json_parser.dumps(rows)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1153, __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_json_parser); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_payload};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_s_step_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_step_id = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1154
 *         elif method == Method.FETCH_ROWS:
 *             step_id = buelon.helpers.json_parser.loads(payload)['step_id']
 *             rows = get_step_status(self, step_id)             # <<<<<<<<<<<<<<
 *             return buelon.helpers.json_parser.dumps(rows)
 *         # elif method == Method.DONE:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_get_step_status); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_self, __pyx_v_step_id};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_v_rows = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1155
 *             step_id = buelon.helpers.json_parser.loads(payload)['step_id']
 *             rows = get_step_status(self, step_id)
 *             return buelon.helpers.json_parser.dumps(rows)             # <<<<<<<<<<<<<<
 *         # elif method == Method.DONE:
 *         #     _done(payload.decode())
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buelon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_helpers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_dumps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_rows};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1155, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1152
 *             steps = self.get_steps(scopes, **kwargs)
 *             return buelon.helpers.json_parser.dumps(steps)
 *         elif method == Method.FETCH_ROWS:             # <<<<<<<<<<<<<<
 *             step_id = buelon.helpers.json_parser.loads(payload)['step_id']
 *             rows = get_step_status(self, step_id)
 */
  }

  /* "buelon/cython/c_hub.pyx":1170
 *         #     step_json, status_value = buelon.helpers.json_parser.loads(payload)
 *         #     _upload_step(step_json, status_value)
 *         elif method == Method.STEP_COUNT:             # <<<<<<<<<<<<<<
 *             kwargs = buelon.helpers.json_parser.loads(payload)
 *             # result = _get_step_count(kwargs['types'])
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Method); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_STEP_COUNT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_method, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1171
 *         #     _upload_step(step_json, status_value)
 *         elif method == Method.STEP_COUNT:
 *             kwargs = buelon.helpers.json_parser.loads(payload)             # <<<<<<<<<<<<<<
 *             # result = _get_step_count(kwargs['types'])
 *             result = _get_step_count(self, kwargs['types'])
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loads); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_payload};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_v_kwargs = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1173
 *             kwargs = buelon.helpers.json_parser.loads(payload)
 *             # result = _get_step_count(kwargs['types'])
 *             result = _get_step_count(self, kwargs['types'])             # <<<<<<<<<<<<<<
 *             return buelon.helpers.json_parser.dumps(result)
 *         # elif method == Method.RESET_ERRORS:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_get_step_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_kwargs, __pyx_n_s_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_v_result = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1174
 *             # result = _get_step_count(kwargs['types'])
 *             result = _get_step_count(self, kwargs['types'])
 *             return buelon.helpers.json_parser.dumps(result)             # <<<<<<<<<<<<<<
 *         # elif method == Method.RESET_ERRORS:
 *         #     _reset_errors(payload)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buelon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_helpers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_dumps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_result};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1170
 *         #     step_json, status_value = buelon.helpers.json_parser.loads(payload)
 *         #     _upload_step(step_json, status_value)
 *         elif method == Method.STEP_COUNT:             # <<<<<<<<<<<<<<
 *             kwargs = buelon.helpers.json_parser.loads(payload)
 *             # result = _get_step_count(kwargs['types'])
 */
  }

  /* "buelon/cython/c_hub.pyx":1177
 *         # elif method == Method.RESET_ERRORS:
 *         #     _reset_errors(payload)
 *         elif method == Method.DELETE_STEPS:             # <<<<<<<<<<<<<<
 *             # _delete_steps()
 *             _delete_steps(self)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Method); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DELETE_STEPS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_method, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1179
 *         elif method == Method.DELETE_STEPS:
 *             # _delete_steps()
 *             _delete_steps(self)             # <<<<<<<<<<<<<<
 *         elif method == Method.FETCH_ERRORS:
 *             try:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_delete_steps_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_self};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1177
 *         # elif method == Method.RESET_ERRORS:
 *         #     _reset_errors(payload)
 *         elif method == Method.DELETE_STEPS:             # <<<<<<<<<<<<<<
 *             # _delete_steps()
 *             _delete_steps(self)
 */
    goto __pyx_L12;
  }

  /* "buelon/cython/c_hub.pyx":1180
 *             # _delete_steps()
 *             _delete_steps(self)
 *         elif method == Method.FETCH_ERRORS:             # <<<<<<<<<<<<<<
 *             try:
 *                 config = buelon.helpers.json_parser.loads(payload)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Method); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_FETCH_ERRORS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_method, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1181
 *             _delete_steps(self)
 *         elif method == Method.FETCH_ERRORS:
 *             try:             # <<<<<<<<<<<<<<
 *                 config = buelon.helpers.json_parser.loads(payload)
 *                 count = int(config.get('count', 5))
 */
    {
      __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:*/ {

        /* "buelon/cython/c_hub.pyx":1182
 *         elif method == Method.FETCH_ERRORS:
 *             try:
 *                 config = buelon.helpers.json_parser.loads(payload)             # <<<<<<<<<<<<<<
 *                 count = int(config.get('count', 5))
 *                 exclude = config.get('exclude', None)
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1182, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1182, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1182, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loads); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1182, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_payload};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1182, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __pyx_v_config = __pyx_t_3;
        __pyx_t_3 = 0;

        /* "buelon/cython/c_hub.pyx":1183
 *             try:
 *                 config = buelon.helpers.json_parser.loads(payload)
 *                 count = int(config.get('count', 5))             # <<<<<<<<<<<<<<
 *                 exclude = config.get('exclude', None)
 * 
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_config, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1183, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1183, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1183, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_count = __pyx_t_3;
        __pyx_t_3 = 0;

        /* "buelon/cython/c_hub.pyx":1184
 *                 config = buelon.helpers.json_parser.loads(payload)
 *                 count = int(config.get('count', 5))
 *                 exclude = config.get('exclude', None)             # <<<<<<<<<<<<<<
 * 
 *                 if not isinstance(exclude, (type(None), str, list)):
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_config, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1184, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1184, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_exclude = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "buelon/cython/c_hub.pyx":1186
 *                 exclude = config.get('exclude', None)
 * 
 *                 if not isinstance(exclude, (type(None), str, list)):             # <<<<<<<<<<<<<<
 *                     raise ValueError('exclude must be a string or a list')
 * 
 */
        __Pyx_INCREF(((PyObject *)Py_TYPE(Py_None)));
        __pyx_t_6 = ((PyObject *)Py_TYPE(Py_None));
        __pyx_t_4 = PyObject_IsInstance(__pyx_v_exclude, __pyx_t_6); 
        if (!__pyx_t_4) {
        } else {
          __pyx_t_1 = __pyx_t_4;
          goto __pyx_L22_bool_binop_done;
        }
        __pyx_t_4 = PyString_Check(__pyx_v_exclude); 
        if (!__pyx_t_4) {
        } else {
          __pyx_t_1 = __pyx_t_4;
          goto __pyx_L22_bool_binop_done;
        }
        __pyx_t_4 = PyList_Check(__pyx_v_exclude); 
        __pyx_t_1 = __pyx_t_4;
        __pyx_L22_bool_binop_done:;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_4 = (!__pyx_t_1);
        if (unlikely(__pyx_t_4)) {

          /* "buelon/cython/c_hub.pyx":1187
 * 
 *                 if not isinstance(exclude, (type(None), str, list)):
 *                     raise ValueError('exclude must be a string or a list')             # <<<<<<<<<<<<<<
 * 
 *                 if isinstance(exclude, list):
 */
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1187, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_Raise(__pyx_t_6, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __PYX_ERR(0, 1187, __pyx_L15_error)

          /* "buelon/cython/c_hub.pyx":1186
 *                 exclude = config.get('exclude', None)
 * 
 *                 if not isinstance(exclude, (type(None), str, list)):             # <<<<<<<<<<<<<<
 *                     raise ValueError('exclude must be a string or a list')
 * 
 */
        }

        /* "buelon/cython/c_hub.pyx":1189
 *                     raise ValueError('exclude must be a string or a list')
 * 
 *                 if isinstance(exclude, list):             # <<<<<<<<<<<<<<
 *                     if not all(isinstance(x, str) for x in exclude):
 *                         raise ValueError('exclude must be a list of strings')
 */
        __pyx_t_4 = PyList_Check(__pyx_v_exclude); 
        if (__pyx_t_4) {

          /* "buelon/cython/c_hub.pyx":1190
 * 
 *                 if isinstance(exclude, list):
 *                     if not all(isinstance(x, str) for x in exclude):             # <<<<<<<<<<<<<<
 *                         raise ValueError('exclude must be a list of strings')
 *             except ValueError:
 */
          __pyx_t_6 = __pyx_pf_6buelon_6cython_5c_hub_9HubServer_16_process_request_genexpr(NULL, __pyx_v_exclude); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1190, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1190, __pyx_L15_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_1 = (!__pyx_t_4);
          if (unlikely(__pyx_t_1)) {

            /* "buelon/cython/c_hub.pyx":1191
 *                 if isinstance(exclude, list):
 *                     if not all(isinstance(x, str) for x in exclude):
 *                         raise ValueError('exclude must be a list of strings')             # <<<<<<<<<<<<<<
 *             except ValueError:
 *                 count = 5
 */
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1191, __pyx_L15_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, 1191, __pyx_L15_error)

            /* "buelon/cython/c_hub.pyx":1190
 * 
 *                 if isinstance(exclude, list):
 *                     if not all(isinstance(x, str) for x in exclude):             # <<<<<<<<<<<<<<
 *                         raise ValueError('exclude must be a list of strings')
 *             except ValueError:
 */
          }

          /* "buelon/cython/c_hub.pyx":1189
 *                     raise ValueError('exclude must be a string or a list')
 * 
 *                 if isinstance(exclude, list):             # <<<<<<<<<<<<<<
 *                     if not all(isinstance(x, str) for x in exclude):
 *                         raise ValueError('exclude must be a list of strings')
 */
        }

        /* "buelon/cython/c_hub.pyx":1181
 *             _delete_steps(self)
 *         elif method == Method.FETCH_ERRORS:
 *             try:             # <<<<<<<<<<<<<<
 *                 config = buelon.helpers.json_parser.loads(payload)
 *                 count = int(config.get('count', 5))
 */
      }
      __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_L20_try_end;
      __pyx_L15_error:;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "buelon/cython/c_hub.pyx":1192
 *                     if not all(isinstance(x, str) for x in exclude):
 *                         raise ValueError('exclude must be a list of strings')
 *             except ValueError:             # <<<<<<<<<<<<<<
 *                 count = 5
 *                 exclude = None
 */
      __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
      if (__pyx_t_12) {
        __Pyx_AddTraceback("buelon.cython.c_hub.HubServer._process_request", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 1192, __pyx_L17_except_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_5);

        /* "buelon/cython/c_hub.pyx":1193
 *                         raise ValueError('exclude must be a list of strings')
 *             except ValueError:
 *                 count = 5             # <<<<<<<<<<<<<<
 *                 exclude = None
 *             return buelon.helpers.json_parser.dumps(_fetch_errors(self, count, exclude))
 */
        __Pyx_INCREF(__pyx_int_5);
        __Pyx_XDECREF_SET(__pyx_v_count, __pyx_int_5);

        /* "buelon/cython/c_hub.pyx":1194
 *             except ValueError:
 *                 count = 5
 *                 exclude = None             # <<<<<<<<<<<<<<
 *             return buelon.helpers.json_parser.dumps(_fetch_errors(self, count, exclude))
 *         return b'ok'
 */
        __Pyx_INCREF(Py_None);
        __Pyx_XDECREF_SET(__pyx_v_exclude, Py_None);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L16_exception_handled;
      }
      goto __pyx_L17_except_error;

      /* "buelon/cython/c_hub.pyx":1181
 *             _delete_steps(self)
 *         elif method == Method.FETCH_ERRORS:
 *             try:             # <<<<<<<<<<<<<<
 *                 config = buelon.helpers.json_parser.loads(payload)
 *                 count = int(config.get('count', 5))
 */
      __pyx_L17_except_error:;
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      goto __pyx_L1_error;
      __pyx_L16_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      __pyx_L20_try_end:;
    }

    /* "buelon/cython/c_hub.pyx":1195
 *                 count = 5
 *                 exclude = None
 *             return buelon.helpers.json_parser.dumps(_fetch_errors(self, count, exclude))             # <<<<<<<<<<<<<<
 *         return b'ok'
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buelon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_helpers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_dumps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_fetch_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_13 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_13, __pyx_v_self, __pyx_v_count, __pyx_v_exclude};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_2 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1195, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1180
 *             # _delete_steps()
 *             _delete_steps(self)
 *         elif method == Method.FETCH_ERRORS:             # <<<<<<<<<<<<<<
 *             try:
 *                 config = buelon.helpers.json_parser.loads(payload)
 */
  }
  __pyx_L12:;

  /* "buelon/cython/c_hub.pyx":1196
 *                 exclude = None
 *             return buelon.helpers.json_parser.dumps(_fetch_errors(self, count, exclude))
 *         return b'ok'             # <<<<<<<<<<<<<<
 * 
 *     def get_steps(self, scopes, limit=100, chunk_size=100, status=buelon.core.step.StepStatus.pending.value,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_n_b_ok);
  __pyx_r = __pyx_n_b_ok;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1142
 *         raise ValueError(f'Invalid method: {method}')
 * 
 *     def _process_request(self, method: Method, payload: bytes):             # <<<<<<<<<<<<<<
 *         if (method == Method.DONE or method == Method.PENDING or method == Method.CANCEL or method == Method.RESET
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer._process_request", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_scopes);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_XDECREF(__pyx_v_steps);
  __Pyx_XDECREF(__pyx_v_step_id);
  __Pyx_XDECREF(__pyx_v_rows);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_config);
  __Pyx_XDECREF(__pyx_v_count);
  __Pyx_XDECREF(__pyx_v_exclude);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubServer_16_process_request_2generator5);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1198
 *         return b'ok'
 * 
 *     def get_steps(self, scopes, limit=100, chunk_size=100, status=buelon.core.step.StepStatus.pending.value,             # <<<<<<<<<<<<<<
 *                   include_working=True, reverse=False):
 *         """
 */

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

  /* "buelon/cython/c_hub.pyx":1199
 * 
 *     def get_steps(self, scopes, limit=100, chunk_size=100, status=buelon.core.step.StepStatus.pending.value,
 *                   include_working=True, reverse=False):             # <<<<<<<<<<<<<<
 *         """
 *             Get the steps in the scope, ordered by priority, velocity, then scope position.
 */
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_int_100));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_100));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_int_100))) __PYX_ERR(0, 1198, __pyx_L1_error);
  __Pyx_INCREF(((PyObject *)__pyx_int_100));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_100));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_int_100))) __PYX_ERR(0, 1198, __pyx_L1_error);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_status);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_status);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_status)) __PYX_ERR(0, 1198, __pyx_L1_error);
  __Pyx_INCREF(((PyObject *)Py_True));
  __Pyx_GIVEREF(((PyObject *)Py_True));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_True))) __PYX_ERR(0, 1198, __pyx_L1_error);
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_False))) __PYX_ERR(0, 1198, __pyx_L1_error);

  /* "buelon/cython/c_hub.pyx":1198
 *         return b'ok'
 * 
 *     def get_steps(self, scopes, limit=100, chunk_size=100, status=buelon.core.step.StepStatus.pending.value,             # <<<<<<<<<<<<<<
 *                   include_working=True, reverse=False):
 *         """
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1198, __pyx_L1_error);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1198, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubServer_19get_steps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6buelon_6cython_5c_hub_9HubServer_18get_steps, "\n            Get the steps in the scope, ordered by priority, velocity, then scope position.\n\n            Args:\n                scopes (list): A list of scopes to filter the steps.\n                limit (int): The maximum number of steps to retrieve. Defaults to 50.\n                chunk_size (int): The number of steps to fetch in each chunk. Defaults to 100.\n                status (int | buelon.core.step.StepStatus.value): The status of the steps to retrieve. Defaults to pending.\n                include_working (bool): Whether to include working steps. Defaults to True.\n                reverse (bool): Whether to reverse the order of the steps. Defaults to False.\n\n            Returns:\n                list: A list of steps ordered by priority, velocity, and scope position.\n            ");
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubServer_19get_steps = {"get_steps", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubServer_19get_steps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6buelon_6cython_5c_hub_9HubServer_18get_steps};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubServer_19get_steps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_scopes = 0;
  PyObject *__pyx_v_limit = 0;
  CYTHON_UNUSED PyObject *__pyx_v_chunk_size = 0;
  PyObject *__pyx_v_status = 0;
  PyObject *__pyx_v_include_working = 0;
  PyObject *__pyx_v_reverse = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_steps (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_scopes,&__pyx_n_s_limit,&__pyx_n_s_chunk_size,&__pyx_n_s_status,&__pyx_n_s_include_working,&__pyx_n_s_reverse,0};
    __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_100)));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_100)));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_status);
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True)));
    values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1198, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scopes)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1198, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("get_steps", 0, 2, 7, 1); __PYX_ERR(0, 1198, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_limit);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1198, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunk_size);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1198, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_status);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1198, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_include_working);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1198, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reverse);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1198, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_steps") < 0)) __PYX_ERR(0, 1198, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_scopes = values[1];
    __pyx_v_limit = values[2];
    __pyx_v_chunk_size = values[3];
    __pyx_v_status = values[4];
    __pyx_v_include_working = values[5];
    __pyx_v_reverse = values[6];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_steps", 0, 2, 7, __pyx_nargs); __PYX_ERR(0, 1198, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer.get_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubServer_18get_steps(__pyx_self, __pyx_v_self, __pyx_v_scopes, __pyx_v_limit, __pyx_v_chunk_size, __pyx_v_status, __pyx_v_include_working, __pyx_v_reverse);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubServer_9get_steps_2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1258
 * 
 *         # Use a single query to fetch all necessary data
 *         query = f"""             # <<<<<<<<<<<<<<
 *         SELECT s.id -- s.id, s.priority, s.scope, s.velocity, s.tag, t.velocity as tag_velocity
 *         FROM steps s
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_9get_steps_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1258, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubServer_9get_steps_2generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubServer_get_steps_locals_genex, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1258, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer.get_steps.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_6buelon_6cython_5c_hub_9HubServer_9get_steps_2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1258, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1258, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1258, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1258, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1258, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1258, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1258, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v__);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_kp_s__22);
    __pyx_r = __pyx_kp_s__22;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1258, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubServer_9get_steps_5generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1287
 *         # Update status to working for selected steps
 *         if steps:
 *             update_query = f"""             # <<<<<<<<<<<<<<
 *             UPDATE steps
 *             SET status = ?, epoch = ?
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_9get_steps_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1287, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubServer_9get_steps_5generator7, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubServer_get_steps_locals_genex, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1287, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer.get_steps.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_6buelon_6cython_5c_hub_9HubServer_9get_steps_5generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1287, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1287, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1287, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1287, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v__);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_s__22);
    __pyx_r = __pyx_kp_s__22;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1287, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1198
 *         return b'ok'
 * 
 *     def get_steps(self, scopes, limit=100, chunk_size=100, status=buelon.core.step.StepStatus.pending.value,             # <<<<<<<<<<<<<<
 *                   include_working=True, reverse=False):
 *         """
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubServer_18get_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_scopes, PyObject *__pyx_v_limit, CYTHON_UNUSED PyObject *__pyx_v_chunk_size, PyObject *__pyx_v_status, PyObject *__pyx_v_include_working, PyObject *__pyx_v_reverse) {
  PyObject *__pyx_v_expiration_time = NULL;
  PyObject *__pyx_v_working_clause = NULL;
  PyObject *__pyx_v_order_by = NULL;
  PyObject *__pyx_v_query = NULL;
  PyObject *__pyx_v_params = NULL;
  PyObject *__pyx_v_rows = NULL;
  PyObject *__pyx_v_steps = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_v_update_query = NULL;
  PyObject *__pyx_v_update_params = NULL;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubServer_9get_steps_2generator6 = 0;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubServer_9get_steps_5generator7 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_steps", 0);
  __Pyx_INCREF(__pyx_v_status);

  /* "buelon/cython/c_hub.pyx":1230
 *         # steps = []
 * 
 *         expiration_time = time.time() - (60 * 60 * .2)  # (60 * 60 * 2)             # <<<<<<<<<<<<<<
 *         status = f'{buelon.core.step.StepStatus(status).value}'
 *         working_clause = ''
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = PyFloat_FromDouble((3600.0 * .2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1230, __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_v_expiration_time = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1231
 * 
 *         expiration_time = time.time() - (60 * 60 * .2)  # (60 * 60 * 2)
 *         status = f'{buelon.core.step.StepStatus(status).value}'             # <<<<<<<<<<<<<<
 *         working_clause = ''
 *         if include_working:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_core); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_status};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_status, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1232
 *         expiration_time = time.time() - (60 * 60 * .2)  # (60 * 60 * 2)
 *         status = f'{buelon.core.step.StepStatus(status).value}'
 *         working_clause = ''             # <<<<<<<<<<<<<<
 *         if include_working:
 *             working_clause = (f' or (epoch < {expiration_time} '
 */
  __Pyx_INCREF(__pyx_kp_s__3);
  __pyx_v_working_clause = __pyx_kp_s__3;

  /* "buelon/cython/c_hub.pyx":1233
 *         status = f'{buelon.core.step.StepStatus(status).value}'
 *         working_clause = ''
 *         if include_working:             # <<<<<<<<<<<<<<
 *             working_clause = (f' or (epoch < {expiration_time} '
 *                               f'     and status = \'{buelon.core.step.StepStatus.working.value}\') ')
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_include_working); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1233, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "buelon/cython/c_hub.pyx":1234
 *         working_clause = ''
 *         if include_working:
 *             working_clause = (f' or (epoch < {expiration_time} '             # <<<<<<<<<<<<<<
 *                               f'     and status = \'{buelon.core.step.StepStatus.working.value}\') ')
 * 
 */
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u_or_epoch);
    __pyx_t_6 += 13;
    __Pyx_GIVEREF(__pyx_kp_u_or_epoch);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_or_epoch);
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_expiration_time, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_and_status);
    __pyx_t_6 += 20;
    __Pyx_GIVEREF(__pyx_kp_u_and_status);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_and_status);

    /* "buelon/cython/c_hub.pyx":1235
 *         if include_working:
 *             working_clause = (f' or (epoch < {expiration_time} '
 *                               f'     and status = \'{buelon.core.step.StepStatus.working.value}\') ')             # <<<<<<<<<<<<<<
 * 
 *         order_by = 'priority desc, epoch'
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_buelon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_working); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__34);
    __pyx_t_6 += 3;
    __Pyx_GIVEREF(__pyx_kp_u__34);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__34);

    /* "buelon/cython/c_hub.pyx":1234
 *         working_clause = ''
 *         if include_working:
 *             working_clause = (f' or (epoch < {expiration_time} '             # <<<<<<<<<<<<<<
 *                               f'     and status = \'{buelon.core.step.StepStatus.working.value}\') ')
 * 
 */
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_working_clause, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1233
 *         status = f'{buelon.core.step.StepStatus(status).value}'
 *         working_clause = ''
 *         if include_working:             # <<<<<<<<<<<<<<
 *             working_clause = (f' or (epoch < {expiration_time} '
 *                               f'     and status = \'{buelon.core.step.StepStatus.working.value}\') ')
 */
  }

  /* "buelon/cython/c_hub.pyx":1237
 *                               f'     and status = \'{buelon.core.step.StepStatus.working.value}\') ')
 * 
 *         order_by = 'priority desc, epoch'             # <<<<<<<<<<<<<<
 *         if reverse:
 *             order_by = 'priority asc, epoch'
 */
  __Pyx_INCREF(__pyx_kp_s_priority_desc_epoch);
  __pyx_v_order_by = __pyx_kp_s_priority_desc_epoch;

  /* "buelon/cython/c_hub.pyx":1238
 * 
 *         order_by = 'priority desc, epoch'
 *         if reverse:             # <<<<<<<<<<<<<<
 *             order_by = 'priority asc, epoch'
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_reverse); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1238, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "buelon/cython/c_hub.pyx":1239
 *         order_by = 'priority desc, epoch'
 *         if reverse:
 *             order_by = 'priority asc, epoch'             # <<<<<<<<<<<<<<
 * 
 *         # ... (keep the existing logic)
 */
    __Pyx_INCREF(__pyx_kp_s_priority_asc_epoch);
    __Pyx_DECREF_SET(__pyx_v_order_by, __pyx_kp_s_priority_asc_epoch);

    /* "buelon/cython/c_hub.pyx":1238
 * 
 *         order_by = 'priority desc, epoch'
 *         if reverse:             # <<<<<<<<<<<<<<
 *             order_by = 'priority asc, epoch'
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":1258
 * 
 *         # Use a single query to fetch all necessary data
 *         query = f"""             # <<<<<<<<<<<<<<
 *         SELECT s.id -- s.id, s.priority, s.scope, s.velocity, s.tag, t.velocity as tag_velocity
 *         FROM steps s
 */
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = 0;
  __pyx_t_7 = 127;
  __Pyx_INCREF(__pyx_kp_u_SELECT_s_id_s_id_s_priority_s_s);
  __pyx_t_6 += 189;
  __Pyx_GIVEREF(__pyx_kp_u_SELECT_s_id_s_id_s_priority_s_s);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_SELECT_s_id_s_id_s_priority_s_s);
  __pyx_t_2 = __pyx_pf_6buelon_6cython_5c_hub_9HubServer_9get_steps_genexpr(NULL, __pyx_v_scopes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__15, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_AND_s_status);
  __pyx_t_6 += 28;
  __Pyx_GIVEREF(__pyx_kp_u_AND_s_status);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_AND_s_status);
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_working_clause, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_ORDER_BY_2);
  __pyx_t_6 += 19;
  __Pyx_GIVEREF(__pyx_kp_u_ORDER_BY_2);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_ORDER_BY_2);
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_order_by, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_LIMIT_2);
  __pyx_t_6 += 25;
  __Pyx_GIVEREF(__pyx_kp_u_LIMIT_2);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_LIMIT_2);
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_query = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1268
 *         """
 * 
 *         params = (*scopes, status, limit)             # <<<<<<<<<<<<<<
 *         rows = self.execute_db_query(query, params)
 * 
 */
  __pyx_t_2 = PySequence_List(__pyx_v_scopes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_ListComp_Append(__pyx_t_2, __pyx_v_status) < 0) __PYX_ERR(0, 1268, __pyx_L1_error)
  if (__Pyx_ListComp_Append(__pyx_t_2, __pyx_v_limit) < 0) __PYX_ERR(0, 1268, __pyx_L1_error)
  {
    PyObject *__pyx_temp = PyList_AsTuple(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_temp; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_params = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1269
 * 
 *         params = (*scopes, status, limit)
 *         rows = self.execute_db_query(query, params)             # <<<<<<<<<<<<<<
 * 
 *         steps = []
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_query, __pyx_v_params};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_rows = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1271
 *         rows = self.execute_db_query(query, params)
 * 
 *         steps = []             # <<<<<<<<<<<<<<
 *         # tag_usage = {}
 * 
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_steps = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1282
 *         #             break
 * 
 *         for row in rows:             # <<<<<<<<<<<<<<
 *             steps.append(row[0])
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_rows)) || PyTuple_CheckExact(__pyx_v_rows)) {
    __pyx_t_2 = __pyx_v_rows; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1282, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1282, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1282, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1282, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1282, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1282, __pyx_L1_error)
        #else
        __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1282, __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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1282, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1283
 * 
 *         for row in rows:
 *             steps.append(row[0])             # <<<<<<<<<<<<<<
 * 
 *         # Update status to working for selected steps
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_row, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_steps, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1283, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1282
 *         #             break
 * 
 *         for row in rows:             # <<<<<<<<<<<<<<
 *             steps.append(row[0])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1286
 * 
 *         # Update status to working for selected steps
 *         if steps:             # <<<<<<<<<<<<<<
 *             update_query = f"""
 *             UPDATE steps
 */
  __pyx_t_5 = (PyList_GET_SIZE(__pyx_v_steps) != 0);
  if (__pyx_t_5) {

    /* "buelon/cython/c_hub.pyx":1287
 *         # Update status to working for selected steps
 *         if steps:
 *             update_query = f"""             # <<<<<<<<<<<<<<
 *             UPDATE steps
 *             SET status = ?, epoch = ?
 */
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u_UPDATE_steps_SET_status_epoch_W);
    __pyx_t_6 += 90;
    __Pyx_GIVEREF(__pyx_kp_u_UPDATE_steps_SET_status_epoch_W);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_UPDATE_steps_SET_status_epoch_W);
    __pyx_t_1 = __pyx_pf_6buelon_6cython_5c_hub_9HubServer_9get_steps_3genexpr(NULL, __pyx_v_steps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__15, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__42);
    __pyx_t_6 += 14;
    __Pyx_GIVEREF(__pyx_kp_u__42);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__42);
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_update_query = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1292
 *             WHERE id IN ({','.join('?' for _ in steps)})
 *             """
 *             update_params = (f'{buelon.core.step.StepStatus.working.value}', time.time(), *steps)             # <<<<<<<<<<<<<<
 *             self.execute_db_query(update_query, update_params)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1292, __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_StepStatus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_working); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1292, __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_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_time); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_time); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __pyx_t_11 = PyList_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_2)) __PYX_ERR(0, 1292, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_3)) __PYX_ERR(0, 1292, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_11;
    __pyx_t_11 = 0;
    if (__Pyx_PyList_Extend(__pyx_t_1, __pyx_v_steps) < 0) __PYX_ERR(0, 1292, __pyx_L1_error)
    {
      PyObject *__pyx_temp = PyList_AsTuple(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1);
      __pyx_t_1 = __pyx_temp; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_update_params = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1293
 *             """
 *             update_params = (f'{buelon.core.step.StepStatus.working.value}', time.time(), *steps)
 *             self.execute_db_query(update_query, update_params)             # <<<<<<<<<<<<<<
 * 
 *         return steps
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_db_query); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_update_query, __pyx_v_update_params};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1286
 * 
 *         # Update status to working for selected steps
 *         if steps:             # <<<<<<<<<<<<<<
 *             update_query = f"""
 *             UPDATE steps
 */
  }

  /* "buelon/cython/c_hub.pyx":1295
 *             self.execute_db_query(update_query, update_params)
 * 
 *         return steps             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_steps);
  __pyx_r = __pyx_v_steps;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1198
 *         return b'ok'
 * 
 *     def get_steps(self, scopes, limit=100, chunk_size=100, status=buelon.core.step.StepStatus.pending.value,             # <<<<<<<<<<<<<<
 *                   include_working=True, reverse=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_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubServer.get_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_expiration_time);
  __Pyx_XDECREF(__pyx_v_working_clause);
  __Pyx_XDECREF(__pyx_v_order_by);
  __Pyx_XDECREF(__pyx_v_query);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XDECREF(__pyx_v_rows);
  __Pyx_XDECREF(__pyx_v_steps);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_update_query);
  __Pyx_XDECREF(__pyx_v_update_params);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubServer_9get_steps_2generator6);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubServer_9get_steps_5generator7);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1299
 * 
 * class HubClient:
 *     def __init__(self, host=None, port=None, max_reconnect_attempts=2):             # <<<<<<<<<<<<<<
 *         self.host = host or os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *         self.port = port or int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubClient_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubClient_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_port = 0;
  PyObject *__pyx_v_max_reconnect_attempts = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_host,&__pyx_n_s_port,&__pyx_n_s_max_reconnect_attempts,0};
    values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_2)));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1299, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_host);
          if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1299, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_port);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1299, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_max_reconnect_attempts);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1299, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 1299, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_host = values[1];
    __pyx_v_port = values[2];
    __pyx_v_max_reconnect_attempts = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 1299, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubClient___init__(__pyx_self, __pyx_v_self, __pyx_v_host, __pyx_v_port, __pyx_v_max_reconnect_attempts);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_max_reconnect_attempts) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "buelon/cython/c_hub.pyx":1300
 * class HubClient:
 *     def __init__(self, host=None, port=None, max_reconnect_attempts=2):
 *         self.host = host or os.environ.get('PIPE_WORKER_HOST', 'localhost')             # <<<<<<<<<<<<<<
 *         self.port = port or int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *         self.conn = None
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_host); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1300, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_host);
    __pyx_t_1 = __pyx_v_host;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_environ); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_1 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L3_bool_binop_done:;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_host, __pyx_t_1) < 0) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1301
 *     def __init__(self, host=None, port=None, max_reconnect_attempts=2):
 *         self.host = host or os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *         self.port = port or int(os.environ.get('PIPE_WORKER_PORT', 65432))             # <<<<<<<<<<<<<<
 *         self.conn = None
 *         self.max_reconnect_attempts = max_reconnect_attempts
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_port); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1301, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_port);
    __pyx_t_1 = __pyx_v_port;
    goto __pyx_L5_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_environ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_1 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L5_bool_binop_done:;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_port, __pyx_t_1) < 0) __PYX_ERR(0, 1301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1302
 *         self.host = host or os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *         self.port = port or int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *         self.conn = None             # <<<<<<<<<<<<<<
 *         self.max_reconnect_attempts = max_reconnect_attempts
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_conn, Py_None) < 0) __PYX_ERR(0, 1302, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1303
 *         self.port = port or int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *         self.conn = None
 *         self.max_reconnect_attempts = max_reconnect_attempts             # <<<<<<<<<<<<<<
 * 
 *         if USING_POSTGRES:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_max_reconnect_attempts, __pyx_v_max_reconnect_attempts) < 0) __PYX_ERR(0, 1303, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1305
 *         self.max_reconnect_attempts = max_reconnect_attempts
 * 
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             self.load_pg()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1305, __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, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1306
 * 
 *         if USING_POSTGRES:
 *             self.load_pg()             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_load_pg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1305
 *         self.max_reconnect_attempts = max_reconnect_attempts
 * 
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             self.load_pg()
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":1299
 * 
 * class HubClient:
 *     def __init__(self, host=None, port=None, max_reconnect_attempts=2):             # <<<<<<<<<<<<<<
 *         self.host = host or os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *         self.port = port or int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */

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

/* "buelon/cython/c_hub.pyx":1308
 *             self.load_pg()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         # self.connect()
 *         return self
 */

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

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

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

  /* "buelon/cython/c_hub.pyx":1310
 *     def __enter__(self):
 *         # self.connect()
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1308
 *             self.load_pg()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         # self.connect()
 *         return self
 */

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

/* "buelon/cython/c_hub.pyx":1312
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         pass
 *         # self.close()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_5__exit__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubClient_5__exit__ = {"__exit__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubClient_5__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_5__exit__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_val = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_tb = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_exc_type,&__pyx_n_s_exc_val,&__pyx_n_s_exc_tb,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1312, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exc_type)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1312, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 1); __PYX_ERR(0, 1312, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exc_val)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1312, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 2); __PYX_ERR(0, 1312, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exc_tb)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1312, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 3); __PYX_ERR(0, 1312, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__exit__") < 0)) __PYX_ERR(0, 1312, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_exc_type = values[1];
    __pyx_v_exc_val = values[2];
    __pyx_v_exc_tb = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 1312, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_4__exit__(__pyx_self, __pyx_v_self, __pyx_v_exc_type, __pyx_v_exc_val, __pyx_v_exc_tb);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_4__exit__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__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
  __Pyx_RefNannySetupContext("__exit__", 1);

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

/* "buelon/cython/c_hub.pyx":1316
 *         # self.close()
 * 
 *     def connect(self):             # <<<<<<<<<<<<<<
 *         if not self.conn:
 *             self.conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 */

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

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

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

  /* "buelon/cython/c_hub.pyx":1317
 * 
 *     def connect(self):
 *         if not self.conn:             # <<<<<<<<<<<<<<
 *             self.conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 *             self.conn.connect((self.host, self.port))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_conn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1317, __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, 1317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "buelon/cython/c_hub.pyx":1318
 *     def connect(self):
 *         if not self.conn:
 *             self.conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)             # <<<<<<<<<<<<<<
 *             self.conn.connect((self.host, self.port))
 *             # self.conn.settimeout(60)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_socket); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_socket); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_socket); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_AF_INET); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_socket); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_SOCK_STREAM); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_6, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_conn, __pyx_t_1) < 0) __PYX_ERR(0, 1318, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1319
 *         if not self.conn:
 *             self.conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 *             self.conn.connect((self.host, self.port))             # <<<<<<<<<<<<<<
 *             # self.conn.settimeout(60)
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_conn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_connect); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_host); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_port); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6)) __PYX_ERR(0, 1319, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1317
 * 
 *     def connect(self):
 *         if not self.conn:             # <<<<<<<<<<<<<<
 *             self.conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 *             self.conn.connect((self.host, self.port))
 */
  }

  /* "buelon/cython/c_hub.pyx":1316
 *         # self.close()
 * 
 *     def connect(self):             # <<<<<<<<<<<<<<
 *         if not self.conn:
 *             self.conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1322
 *             # self.conn.settimeout(60)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if self.conn:
 *             self.conn.close()
 */

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

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

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

  /* "buelon/cython/c_hub.pyx":1323
 * 
 *     def close(self):
 *         if self.conn:             # <<<<<<<<<<<<<<
 *             self.conn.close()
 *             self.conn = None
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_conn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __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, 1323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1324
 *     def close(self):
 *         if self.conn:
 *             self.conn.close()             # <<<<<<<<<<<<<<
 *             self.conn = None
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_conn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1325
 *         if self.conn:
 *             self.conn.close()
 *             self.conn = None             # <<<<<<<<<<<<<<
 * 
 *     def send_request(self, method, data: bytes, timeout: int | float = 5, increments: int | float | Callable = 5, attempts: int = 4):
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_conn, Py_None) < 0) __PYX_ERR(0, 1325, __pyx_L1_error)

    /* "buelon/cython/c_hub.pyx":1323
 * 
 *     def close(self):
 *         if self.conn:             # <<<<<<<<<<<<<<
 *             self.conn.close()
 *             self.conn = None
 */
  }

  /* "buelon/cython/c_hub.pyx":1322
 *             # self.conn.settimeout(60)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if self.conn:
 *             self.conn.close()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1327
 *             self.conn = None
 * 
 *     def send_request(self, method, data: bytes, timeout: int | float = 5, increments: int | float | Callable = 5, attempts: int = 4):             # <<<<<<<<<<<<<<
 *         try:
 *             # socket.setdefaulttimeout(timeout)
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_90__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 1);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_int_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_5));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_int_5))) __PYX_ERR(0, 1327, __pyx_L1_error);
  __Pyx_INCREF(((PyObject *)__pyx_int_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_5));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_int_5))) __PYX_ERR(0, 1327, __pyx_L1_error);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_attempts);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_attempts);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_attempts)) __PYX_ERR(0, 1327, __pyx_L1_error);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1327, __pyx_L1_error);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1327, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_11send_request(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubClient_11send_request = {"send_request", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubClient_11send_request, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_11send_request(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_timeout = 0;
  PyObject *__pyx_v_increments = 0;
  PyObject *__pyx_v_attempts = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_request (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_method,&__pyx_n_s_data,&__pyx_n_s_timeout,&__pyx_n_s_increments,&__pyx_n_s_attempts,0};
    __pyx_defaults3 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self);
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_5)));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_5)));
    values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_attempts);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1327, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_method)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1327, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("send_request", 0, 3, 6, 1); __PYX_ERR(0, 1327, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1327, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("send_request", 0, 3, 6, 2); __PYX_ERR(0, 1327, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1327, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_increments);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1327, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_attempts);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1327, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "send_request") < 0)) __PYX_ERR(0, 1327, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_method = values[1];
    __pyx_v_data = ((PyObject*)values[2]);
    __pyx_v_timeout = values[3];
    __pyx_v_increments = values[4];
    __pyx_v_attempts = ((PyObject*)values[5]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("send_request", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 1327, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.send_request", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 0, "data", 1))) __PYX_ERR(0, 1327, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_attempts), (&PyInt_Type), 0, "attempts", 1))) __PYX_ERR(0, 1327, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_10send_request(__pyx_self, __pyx_v_self, __pyx_v_method, __pyx_v_data, __pyx_v_timeout, __pyx_v_increments, __pyx_v_attempts);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_10send_request(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_data, PyObject *__pyx_v_timeout, PyObject *__pyx_v_increments, PyObject *__pyx_v_attempts) {
  PyObject *__pyx_v_conn = NULL;
  PyObject *__pyx_v_request = NULL;
  PyObject *__pyx_v_response = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_warnings = 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;
  unsigned int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  int __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  char const *__pyx_t_21;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  Py_ssize_t __pyx_t_28;
  Py_UCS4 __pyx_t_29;
  int __pyx_t_30;
  PyObject *__pyx_t_31 = NULL;
  char const *__pyx_t_32;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_request", 0);
  __Pyx_INCREF(__pyx_v_timeout);

  /* "buelon/cython/c_hub.pyx":1328
 * 
 *     def send_request(self, method, data: bytes, timeout: int | float = 5, increments: int | float | Callable = 5, attempts: int = 4):
 *         try:             # <<<<<<<<<<<<<<
 *             # socket.setdefaulttimeout(timeout)
 *             with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as conn:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "buelon/cython/c_hub.pyx":1330
 *         try:
 *             # socket.setdefaulttimeout(timeout)
 *             with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as conn:             # <<<<<<<<<<<<<<
 *                 conn.settimeout(timeout)
 *                 conn.connect((self.host, self.port))
 */
      /*with:*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_socket); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1330, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_socket); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1330, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_socket); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1330, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_AF_INET); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1330, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_socket); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1330, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_SOCK_STREAM); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1330, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        __pyx_t_9 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_9 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_7, __pyx_t_8};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1330, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1330, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1330, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = NULL;
        __pyx_t_9 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
            __pyx_t_9 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1330, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __pyx_t_8 = __pyx_t_6;
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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:*/ {
              __pyx_v_conn = __pyx_t_8;
              __pyx_t_8 = 0;

              /* "buelon/cython/c_hub.pyx":1331
 *             # socket.setdefaulttimeout(timeout)
 *             with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as conn:
 *                 conn.settimeout(timeout)             # <<<<<<<<<<<<<<
 *                 conn.connect((self.host, self.port))
 *                 request = method.value.encode() + PIPELINE_SPLIT_TOKEN + data
 */
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_settimeout); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1331, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_6 = NULL;
              __pyx_t_9 = 0;
              #if CYTHON_UNPACK_METHODS
              if (likely(PyMethod_Check(__pyx_t_4))) {
                __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
                if (likely(__pyx_t_6)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                  __Pyx_INCREF(__pyx_t_6);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_4, function);
                  __pyx_t_9 = 1;
                }
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_timeout};
                __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1331, __pyx_L13_error)
                __Pyx_GOTREF(__pyx_t_8);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              }
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

              /* "buelon/cython/c_hub.pyx":1332
 *             with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as conn:
 *                 conn.settimeout(timeout)
 *                 conn.connect((self.host, self.port))             # <<<<<<<<<<<<<<
 *                 request = method.value.encode() + PIPELINE_SPLIT_TOKEN + data
 *                 send(conn, request)
 */
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_connect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1332, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_host); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1332, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_port); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1332, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_6);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(0, 1332, __pyx_L13_error);
              __Pyx_GIVEREF(__pyx_t_7);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7)) __PYX_ERR(0, 1332, __pyx_L13_error);
              __pyx_t_6 = 0;
              __pyx_t_7 = 0;
              __pyx_t_7 = NULL;
              __pyx_t_9 = 0;
              #if CYTHON_UNPACK_METHODS
              if (likely(PyMethod_Check(__pyx_t_4))) {
                __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
                if (likely(__pyx_t_7)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                  __Pyx_INCREF(__pyx_t_7);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_4, function);
                  __pyx_t_9 = 1;
                }
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
                __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1332, __pyx_L13_error)
                __Pyx_GOTREF(__pyx_t_8);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              }
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

              /* "buelon/cython/c_hub.pyx":1333
 *                 conn.settimeout(timeout)
 *                 conn.connect((self.host, self.port))
 *                 request = method.value.encode() + PIPELINE_SPLIT_TOKEN + data             # <<<<<<<<<<<<<<
 *                 send(conn, request)
 *                 try:
 */
              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_method, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1333, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1333, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_t_4 = NULL;
              __pyx_t_9 = 0;
              #if CYTHON_UNPACK_METHODS
              if (likely(PyMethod_Check(__pyx_t_5))) {
                __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
                if (likely(__pyx_t_4)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                  __Pyx_INCREF(__pyx_t_4);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_5, function);
                  __pyx_t_9 = 1;
                }
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
                __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1333, __pyx_L13_error)
                __Pyx_GOTREF(__pyx_t_8);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              }
              __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PIPELINE_SPLIT_TOKEN); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1333, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1333, __pyx_L13_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_t_5 = PyNumber_Add(__pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1333, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __pyx_v_request = __pyx_t_5;
              __pyx_t_5 = 0;

              /* "buelon/cython/c_hub.pyx":1334
 *                 conn.connect((self.host, self.port))
 *                 request = method.value.encode() + PIPELINE_SPLIT_TOKEN + data
 *                 send(conn, request)             # <<<<<<<<<<<<<<
 *                 try:
 *                     response = timeout_func(receive, (conn,), timeout_duration=timeout, default='__fail__')
 */
              __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_send); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1334, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_8 = NULL;
              __pyx_t_9 = 0;
              #if CYTHON_UNPACK_METHODS
              if (unlikely(PyMethod_Check(__pyx_t_4))) {
                __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
                if (likely(__pyx_t_8)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                  __Pyx_INCREF(__pyx_t_8);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_4, function);
                  __pyx_t_9 = 1;
                }
              }
              #endif
              {
                PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_conn, __pyx_v_request};
                __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
                __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
                if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1334, __pyx_L13_error)
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              }
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

              /* "buelon/cython/c_hub.pyx":1335
 *                 request = method.value.encode() + PIPELINE_SPLIT_TOKEN + data
 *                 send(conn, request)
 *                 try:             # <<<<<<<<<<<<<<
 *                     response = timeout_func(receive, (conn,), timeout_duration=timeout, default='__fail__')
 *                 except ValueError as e:
 */
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
                __Pyx_XGOTREF(__pyx_t_14);
                __Pyx_XGOTREF(__pyx_t_15);
                __Pyx_XGOTREF(__pyx_t_16);
                /*try:*/ {

                  /* "buelon/cython/c_hub.pyx":1336
 *                 send(conn, request)
 *                 try:
 *                     response = timeout_func(receive, (conn,), timeout_duration=timeout, default='__fail__')             # <<<<<<<<<<<<<<
 *                 except ValueError as e:
 *                     if 'signal only works in main thread of the main interpreter' not in str(e):
 */
                  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_timeout_func); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1336, __pyx_L19_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_receive); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1336, __pyx_L19_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1336, __pyx_L19_error)
                  __Pyx_GOTREF(__pyx_t_8);
                  __Pyx_INCREF(__pyx_v_conn);
                  __Pyx_GIVEREF(__pyx_v_conn);
                  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_conn)) __PYX_ERR(0, 1336, __pyx_L19_error);
                  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1336, __pyx_L19_error)
                  __Pyx_GOTREF(__pyx_t_7);
                  __Pyx_GIVEREF(__pyx_t_4);
                  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 1336, __pyx_L19_error);
                  __Pyx_GIVEREF(__pyx_t_8);
                  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(0, 1336, __pyx_L19_error);
                  __pyx_t_4 = 0;
                  __pyx_t_8 = 0;
                  __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1336, __pyx_L19_error)
                  __Pyx_GOTREF(__pyx_t_8);
                  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_timeout_duration, __pyx_v_timeout) < 0) __PYX_ERR(0, 1336, __pyx_L19_error)
                  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_default, __pyx_n_s_fail) < 0) __PYX_ERR(0, 1336, __pyx_L19_error)
                  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1336, __pyx_L19_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_v_response = __pyx_t_4;
                  __pyx_t_4 = 0;

                  /* "buelon/cython/c_hub.pyx":1335
 *                 request = method.value.encode() + PIPELINE_SPLIT_TOKEN + data
 *                 send(conn, request)
 *                 try:             # <<<<<<<<<<<<<<
 *                     response = timeout_func(receive, (conn,), timeout_duration=timeout, default='__fail__')
 *                 except ValueError as e:
 */
                }
                __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                goto __pyx_L24_try_end;
                __pyx_L19_error:;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

                /* "buelon/cython/c_hub.pyx":1337
 *                 try:
 *                     response = timeout_func(receive, (conn,), timeout_duration=timeout, default='__fail__')
 *                 except ValueError as e:             # <<<<<<<<<<<<<<
 *                     if 'signal only works in main thread of the main interpreter' not in str(e):
 *                         raise
 */
                __pyx_t_17 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
                if (__pyx_t_17) {
                  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.send_request", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_7) < 0) __PYX_ERR(0, 1337, __pyx_L21_except_error)
                  __Pyx_XGOTREF(__pyx_t_4);
                  __Pyx_XGOTREF(__pyx_t_8);
                  __Pyx_XGOTREF(__pyx_t_7);
                  __Pyx_INCREF(__pyx_t_8);
                  __pyx_v_e = __pyx_t_8;
                  /*try:*/ {

                    /* "buelon/cython/c_hub.pyx":1338
 *                     response = timeout_func(receive, (conn,), timeout_duration=timeout, default='__fail__')
 *                 except ValueError as e:
 *                     if 'signal only works in main thread of the main interpreter' not in str(e):             # <<<<<<<<<<<<<<
 *                         raise
 *                     import warnings
 */
                    __pyx_t_5 = __Pyx_PyObject_Str(__pyx_v_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1338, __pyx_L30_error)
                    __Pyx_GOTREF(__pyx_t_5);
                    __pyx_t_18 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_signal_only_works_in_main_thread, __pyx_t_5, Py_NE)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1338, __pyx_L30_error)
                    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                    if (unlikely(__pyx_t_18)) {

                      /* "buelon/cython/c_hub.pyx":1339
 *                 except ValueError as e:
 *                     if 'signal only works in main thread of the main interpreter' not in str(e):
 *                         raise             # <<<<<<<<<<<<<<
 *                     import warnings
 *                     warnings.warn('HubClient used outside the main thread cannot use signal.py to timeout connections.')
 */
                      __Pyx_GIVEREF(__pyx_t_4);
                      __Pyx_GIVEREF(__pyx_t_8);
                      __Pyx_XGIVEREF(__pyx_t_7);
                      __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_8, __pyx_t_7);
                      __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; 
                      __PYX_ERR(0, 1339, __pyx_L30_error)

                      /* "buelon/cython/c_hub.pyx":1338
 *                     response = timeout_func(receive, (conn,), timeout_duration=timeout, default='__fail__')
 *                 except ValueError as e:
 *                     if 'signal only works in main thread of the main interpreter' not in str(e):             # <<<<<<<<<<<<<<
 *                         raise
 *                     import warnings
 */
                    }

                    /* "buelon/cython/c_hub.pyx":1340
 *                     if 'signal only works in main thread of the main interpreter' not in str(e):
 *                         raise
 *                     import warnings             # <<<<<<<<<<<<<<
 *                     warnings.warn('HubClient used outside the main thread cannot use signal.py to timeout connections.')
 *                     socket.setdefaulttimeout(timeout)
 */
                    __pyx_t_5 = __Pyx_ImportDottedModule(__pyx_n_s_warnings, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1340, __pyx_L30_error)
                    __Pyx_GOTREF(__pyx_t_5);
                    __pyx_v_warnings = __pyx_t_5;
                    __pyx_t_5 = 0;

                    /* "buelon/cython/c_hub.pyx":1341
 *                         raise
 *                     import warnings
 *                     warnings.warn('HubClient used outside the main thread cannot use signal.py to timeout connections.')             # <<<<<<<<<<<<<<
 *                     socket.setdefaulttimeout(timeout)
 *                     conn.settimeout(timeout)
 */
                    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1341, __pyx_L30_error)
                    __Pyx_GOTREF(__pyx_t_6);
                    __pyx_t_19 = NULL;
                    __pyx_t_9 = 0;
                    #if CYTHON_UNPACK_METHODS
                    if (likely(PyMethod_Check(__pyx_t_6))) {
                      __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_6);
                      if (likely(__pyx_t_19)) {
                        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
                        __Pyx_INCREF(__pyx_t_19);
                        __Pyx_INCREF(function);
                        __Pyx_DECREF_SET(__pyx_t_6, function);
                        __pyx_t_9 = 1;
                      }
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2] = {__pyx_t_19, __pyx_kp_s_HubClient_used_outside_the_main};
                      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
                      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1341, __pyx_L30_error)
                      __Pyx_GOTREF(__pyx_t_5);
                      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                    }
                    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                    /* "buelon/cython/c_hub.pyx":1342
 *                     import warnings
 *                     warnings.warn('HubClient used outside the main thread cannot use signal.py to timeout connections.')
 *                     socket.setdefaulttimeout(timeout)             # <<<<<<<<<<<<<<
 *                     conn.settimeout(timeout)
 *                     response = receive(conn,)
 */
                    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_socket); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1342, __pyx_L30_error)
                    __Pyx_GOTREF(__pyx_t_6);
                    __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_setdefaulttimeout); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1342, __pyx_L30_error)
                    __Pyx_GOTREF(__pyx_t_19);
                    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                    __pyx_t_6 = NULL;
                    __pyx_t_9 = 0;
                    #if CYTHON_UNPACK_METHODS
                    if (unlikely(PyMethod_Check(__pyx_t_19))) {
                      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_19);
                      if (likely(__pyx_t_6)) {
                        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
                        __Pyx_INCREF(__pyx_t_6);
                        __Pyx_INCREF(function);
                        __Pyx_DECREF_SET(__pyx_t_19, function);
                        __pyx_t_9 = 1;
                      }
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_timeout};
                      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
                      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1342, __pyx_L30_error)
                      __Pyx_GOTREF(__pyx_t_5);
                      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                    }
                    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                    /* "buelon/cython/c_hub.pyx":1343
 *                     warnings.warn('HubClient used outside the main thread cannot use signal.py to timeout connections.')
 *                     socket.setdefaulttimeout(timeout)
 *                     conn.settimeout(timeout)             # <<<<<<<<<<<<<<
 *                     response = receive(conn,)
 *                 if response == '__fail__':
 */
                    __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_settimeout); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1343, __pyx_L30_error)
                    __Pyx_GOTREF(__pyx_t_19);
                    __pyx_t_6 = NULL;
                    __pyx_t_9 = 0;
                    #if CYTHON_UNPACK_METHODS
                    if (likely(PyMethod_Check(__pyx_t_19))) {
                      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_19);
                      if (likely(__pyx_t_6)) {
                        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
                        __Pyx_INCREF(__pyx_t_6);
                        __Pyx_INCREF(function);
                        __Pyx_DECREF_SET(__pyx_t_19, function);
                        __pyx_t_9 = 1;
                      }
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_timeout};
                      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
                      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1343, __pyx_L30_error)
                      __Pyx_GOTREF(__pyx_t_5);
                      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                    }
                    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                    /* "buelon/cython/c_hub.pyx":1344
 *                     socket.setdefaulttimeout(timeout)
 *                     conn.settimeout(timeout)
 *                     response = receive(conn,)             # <<<<<<<<<<<<<<
 *                 if response == '__fail__':
 *                     raise TimeoutError(f"Request timed out after {timeout} seconds")
 */
                    __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_receive); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1344, __pyx_L30_error)
                    __Pyx_GOTREF(__pyx_t_19);
                    __pyx_t_6 = NULL;
                    __pyx_t_9 = 0;
                    #if CYTHON_UNPACK_METHODS
                    if (unlikely(PyMethod_Check(__pyx_t_19))) {
                      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_19);
                      if (likely(__pyx_t_6)) {
                        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
                        __Pyx_INCREF(__pyx_t_6);
                        __Pyx_INCREF(function);
                        __Pyx_DECREF_SET(__pyx_t_19, function);
                        __pyx_t_9 = 1;
                      }
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_conn};
                      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
                      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1344, __pyx_L30_error)
                      __Pyx_GOTREF(__pyx_t_5);
                      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                    }
                    __Pyx_XDECREF_SET(__pyx_v_response, __pyx_t_5);
                    __pyx_t_5 = 0;
                  }

                  /* "buelon/cython/c_hub.pyx":1337
 *                 try:
 *                     response = timeout_func(receive, (conn,), timeout_duration=timeout, default='__fail__')
 *                 except ValueError as e:             # <<<<<<<<<<<<<<
 *                     if 'signal only works in main thread of the main interpreter' not in str(e):
 *                         raise
 */
                  /*finally:*/ {
                    /*normal exit:*/{
                      __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
                      goto __pyx_L31;
                    }
                    __pyx_L30_error:;
                    /*exception exit:*/{
                      __Pyx_PyThreadState_declare
                      __Pyx_PyThreadState_assign
                      __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
                      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
                      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
                      __Pyx_XGOTREF(__pyx_t_22);
                      __Pyx_XGOTREF(__pyx_t_23);
                      __Pyx_XGOTREF(__pyx_t_24);
                      __Pyx_XGOTREF(__pyx_t_25);
                      __Pyx_XGOTREF(__pyx_t_26);
                      __Pyx_XGOTREF(__pyx_t_27);
                      __pyx_t_17 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
                      {
                        __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
                      }
                      if (PY_MAJOR_VERSION >= 3) {
                        __Pyx_XGIVEREF(__pyx_t_25);
                        __Pyx_XGIVEREF(__pyx_t_26);
                        __Pyx_XGIVEREF(__pyx_t_27);
                        __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27);
                      }
                      __Pyx_XGIVEREF(__pyx_t_22);
                      __Pyx_XGIVEREF(__pyx_t_23);
                      __Pyx_XGIVEREF(__pyx_t_24);
                      __Pyx_ErrRestore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
                      __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
                      __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21;
                      goto __pyx_L21_except_error;
                    }
                    __pyx_L31:;
                  }
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                  goto __pyx_L20_exception_handled;
                }
                goto __pyx_L21_except_error;

                /* "buelon/cython/c_hub.pyx":1335
 *                 request = method.value.encode() + PIPELINE_SPLIT_TOKEN + data
 *                 send(conn, request)
 *                 try:             # <<<<<<<<<<<<<<
 *                     response = timeout_func(receive, (conn,), timeout_duration=timeout, default='__fail__')
 *                 except ValueError as e:
 */
                __pyx_L21_except_error:;
                __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);
                goto __pyx_L13_error;
                __pyx_L20_exception_handled:;
                __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_L24_try_end:;
              }

              /* "buelon/cython/c_hub.pyx":1345
 *                     conn.settimeout(timeout)
 *                     response = receive(conn,)
 *                 if response == '__fail__':             # <<<<<<<<<<<<<<
 *                     raise TimeoutError(f"Request timed out after {timeout} seconds")
 *         except (TimeoutError, socket.timeout, ConnectionRefusedError) as e:
 */
              __pyx_t_18 = (__Pyx_PyString_Equals(__pyx_v_response, __pyx_n_s_fail, Py_EQ)); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1345, __pyx_L13_error)
              if (unlikely(__pyx_t_18)) {

                /* "buelon/cython/c_hub.pyx":1346
 *                     response = receive(conn,)
 *                 if response == '__fail__':
 *                     raise TimeoutError(f"Request timed out after {timeout} seconds")             # <<<<<<<<<<<<<<
 *         except (TimeoutError, socket.timeout, ConnectionRefusedError) as e:
 *             if attempts <= 0:
 */
                __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1346, __pyx_L13_error)
                __Pyx_GOTREF(__pyx_t_7);
                __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1346, __pyx_L13_error)
                __Pyx_GOTREF(__pyx_t_8);
                __pyx_t_28 = 0;
                __pyx_t_29 = 127;
                __Pyx_INCREF(__pyx_kp_u_Request_timed_out_after);
                __pyx_t_28 += 24;
                __Pyx_GIVEREF(__pyx_kp_u_Request_timed_out_after);
                PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_kp_u_Request_timed_out_after);
                __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_timeout, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __pyx_L13_error)
                __Pyx_GOTREF(__pyx_t_4);
                __pyx_t_29 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_29) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_29;
                __pyx_t_28 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
                __Pyx_GIVEREF(__pyx_t_4);
                PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4);
                __pyx_t_4 = 0;
                __Pyx_INCREF(__pyx_kp_u_seconds);
                __pyx_t_28 += 8;
                __Pyx_GIVEREF(__pyx_kp_u_seconds);
                PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_u_seconds);
                __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_8, 3, __pyx_t_28, __pyx_t_29); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __pyx_L13_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1346, __pyx_L13_error)
                __Pyx_GOTREF(__pyx_t_8);
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_Raise(__pyx_t_8, 0, 0, 0);
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                __PYX_ERR(0, 1346, __pyx_L13_error)

                /* "buelon/cython/c_hub.pyx":1345
 *                     conn.settimeout(timeout)
 *                     response = receive(conn,)
 *                 if response == '__fail__':             # <<<<<<<<<<<<<<
 *                     raise TimeoutError(f"Request timed out after {timeout} seconds")
 *         except (TimeoutError, socket.timeout, ConnectionRefusedError) as e:
 */
              }

              /* "buelon/cython/c_hub.pyx":1330
 *         try:
 *             # socket.setdefaulttimeout(timeout)
 *             with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as conn:             # <<<<<<<<<<<<<<
 *                 conn.settimeout(timeout)
 *                 conn.connect((self.host, self.port))
 */
            }
            __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_L18_try_end;
            __pyx_L13_error:;
            __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            /*except:*/ {
              __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.send_request", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 1330, __pyx_L15_except_error)
              __Pyx_XGOTREF(__pyx_t_8);
              __Pyx_XGOTREF(__pyx_t_4);
              __Pyx_XGOTREF(__pyx_t_7);
              __pyx_t_5 = PyTuple_Pack(3, __pyx_t_8, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1330, __pyx_L15_except_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1330, __pyx_L15_except_error)
              __Pyx_GOTREF(__pyx_t_16);
              __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_16);
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
              if (__pyx_t_18 < 0) __PYX_ERR(0, 1330, __pyx_L15_except_error)
              __pyx_t_30 = (!__pyx_t_18);
              if (unlikely(__pyx_t_30)) {
                __Pyx_GIVEREF(__pyx_t_8);
                __Pyx_GIVEREF(__pyx_t_4);
                __Pyx_XGIVEREF(__pyx_t_7);
                __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_4, __pyx_t_7);
                __pyx_t_8 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0; 
                __PYX_ERR(0, 1330, __pyx_L15_except_error)
              }
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              goto __pyx_L14_exception_handled;
            }
            __pyx_L15_except_error:;
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
            goto __pyx_L3_error;
            __pyx_L14_exception_handled:;
            __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_L18_try_end:;
          }
        }
        /*finally:*/ {
          /*normal exit:*/{
            if (__pyx_t_10) {
              __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__5, NULL);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1330, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
            goto __pyx_L12;
          }
          __pyx_L12:;
        }
        goto __pyx_L41;
        __pyx_L9_error:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L3_error;
        __pyx_L41:;
      }

      /* "buelon/cython/c_hub.pyx":1328
 * 
 *     def send_request(self, method, data: bytes, timeout: int | float = 5, increments: int | float | Callable = 5, attempts: int = 4):
 *         try:             # <<<<<<<<<<<<<<
 *             # socket.setdefaulttimeout(timeout)
 *             with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as conn:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "buelon/cython/c_hub.pyx":1347
 *                 if response == '__fail__':
 *                     raise TimeoutError(f"Request timed out after {timeout} seconds")
 *         except (TimeoutError, socket.timeout, ConnectionRefusedError) as e:             # <<<<<<<<<<<<<<
 *             if attempts <= 0:
 *                 raise
 */
    __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_4, &__pyx_t_8);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_TimeoutError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1347, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_socket); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1347, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_19);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_timeout); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1347, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_ConnectionRefusedError); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1347, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_19);
    __pyx_t_20 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_7, __pyx_t_5) || __Pyx_PyErr_GivenExceptionMatches(__pyx_t_7, __pyx_t_6) || __Pyx_PyErr_GivenExceptionMatches(__pyx_t_7, __pyx_t_19);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_ErrRestore(__pyx_t_7, __pyx_t_4, __pyx_t_8);
    __pyx_t_7 = 0; __pyx_t_4 = 0; __pyx_t_8 = 0;
    if (__pyx_t_20) {
      __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.send_request", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 1347, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_4);
      /*try:*/ {

        /* "buelon/cython/c_hub.pyx":1348
 *                     raise TimeoutError(f"Request timed out after {timeout} seconds")
 *         except (TimeoutError, socket.timeout, ConnectionRefusedError) as e:
 *             if attempts <= 0:             # <<<<<<<<<<<<<<
 *                 raise
 *             print(f"{type(e).__name__} error: {e}")
 */
        __pyx_t_19 = PyObject_RichCompare(__pyx_v_attempts, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1348, __pyx_L47_error)
        __pyx_t_30 = __Pyx_PyObject_IsTrue(__pyx_t_19); if (unlikely((__pyx_t_30 < 0))) __PYX_ERR(0, 1348, __pyx_L47_error)
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        if (unlikely(__pyx_t_30)) {

          /* "buelon/cython/c_hub.pyx":1349
 *         except (TimeoutError, socket.timeout, ConnectionRefusedError) as e:
 *             if attempts <= 0:
 *                 raise             # <<<<<<<<<<<<<<
 *             print(f"{type(e).__name__} error: {e}")
 *             time.sleep(1)  # Backoff before retrying
 */
          __Pyx_GIVEREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_4, __pyx_t_7);
          __pyx_t_8 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0; 
          __PYX_ERR(0, 1349, __pyx_L47_error)

          /* "buelon/cython/c_hub.pyx":1348
 *                     raise TimeoutError(f"Request timed out after {timeout} seconds")
 *         except (TimeoutError, socket.timeout, ConnectionRefusedError) as e:
 *             if attempts <= 0:             # <<<<<<<<<<<<<<
 *                 raise
 *             print(f"{type(e).__name__} error: {e}")
 */
        }

        /* "buelon/cython/c_hub.pyx":1350
 *             if attempts <= 0:
 *                 raise
 *             print(f"{type(e).__name__} error: {e}")             # <<<<<<<<<<<<<<
 *             time.sleep(1)  # Backoff before retrying
 *             timeout = timeout + increments if not callable(increments) else increments(timeout, attempts)
 */
        __pyx_t_19 = PyTuple_New(3); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1350, __pyx_L47_error)
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_28 = 0;
        __pyx_t_29 = 127;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_e)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1350, __pyx_L47_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1350, __pyx_L47_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_29 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_29) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_29;
        __pyx_t_28 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_5);
        __pyx_t_5 = 0;
        __Pyx_INCREF(__pyx_kp_u_error_3);
        __pyx_t_28 += 8;
        __Pyx_GIVEREF(__pyx_kp_u_error_3);
        PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_kp_u_error_3);
        __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_e, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1350, __pyx_L47_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_29 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_29) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_29;
        __pyx_t_28 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_19, 3, __pyx_t_28, __pyx_t_29); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1350, __pyx_L47_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_5); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1350, __pyx_L47_error)
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

        /* "buelon/cython/c_hub.pyx":1351
 *                 raise
 *             print(f"{type(e).__name__} error: {e}")
 *             time.sleep(1)  # Backoff before retrying             # <<<<<<<<<<<<<<
 *             timeout = timeout + increments if not callable(increments) else increments(timeout, attempts)
 *             return self.send_request(method, data, timeout, increments, attempts - 1)
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1351, __pyx_L47_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sleep); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1351, __pyx_L47_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        __pyx_t_9 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_9 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_int_1};
          __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1351, __pyx_L47_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

        /* "buelon/cython/c_hub.pyx":1352
 *             print(f"{type(e).__name__} error: {e}")
 *             time.sleep(1)  # Backoff before retrying
 *             timeout = timeout + increments if not callable(increments) else increments(timeout, attempts)             # <<<<<<<<<<<<<<
 *             return self.send_request(method, data, timeout, increments, attempts - 1)
 * 
 */
        __pyx_t_30 = __Pyx_PyCallable_Check(__pyx_v_increments); if (unlikely(__pyx_t_30 == ((int)-1))) __PYX_ERR(0, 1352, __pyx_L47_error)
        __pyx_t_18 = (!__pyx_t_30);
        if (__pyx_t_18) {
          __pyx_t_6 = PyNumber_Add(__pyx_v_timeout, __pyx_v_increments); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1352, __pyx_L47_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_19 = __pyx_t_6;
          __pyx_t_6 = 0;
        } else {
          __Pyx_INCREF(__pyx_v_increments);
          __pyx_t_5 = __pyx_v_increments; __pyx_t_31 = NULL;
          __pyx_t_9 = 0;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_31 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_31)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_31);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
              __pyx_t_9 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_31, __pyx_v_timeout, __pyx_v_attempts};
            __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
            __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1352, __pyx_L47_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
          __pyx_t_19 = __pyx_t_6;
          __pyx_t_6 = 0;
        }
        __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_19);
        __pyx_t_19 = 0;

        /* "buelon/cython/c_hub.pyx":1353
 *             time.sleep(1)  # Backoff before retrying
 *             timeout = timeout + increments if not callable(increments) else increments(timeout, attempts)
 *             return self.send_request(method, data, timeout, increments, attempts - 1)             # <<<<<<<<<<<<<<
 * 
 *         return response
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_request); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1353, __pyx_L47_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PyNumber_Subtract(__pyx_v_attempts, __pyx_int_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1353, __pyx_L47_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_31 = NULL;
        __pyx_t_9 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_31 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_31)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_31);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_9 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[6] = {__pyx_t_31, __pyx_v_method, __pyx_v_data, __pyx_v_timeout, __pyx_v_increments, __pyx_t_5};
          __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 5+__pyx_t_9);
          __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1353, __pyx_L47_error)
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __pyx_r = __pyx_t_19;
        __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L46_return;
      }

      /* "buelon/cython/c_hub.pyx":1347
 *                 if response == '__fail__':
 *                     raise TimeoutError(f"Request timed out after {timeout} seconds")
 *         except (TimeoutError, socket.timeout, ConnectionRefusedError) as e:             # <<<<<<<<<<<<<<
 *             if attempts <= 0:
 *                 raise
 */
      /*finally:*/ {
        __pyx_L47_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_16, &__pyx_t_15);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_13, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_13, &__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_15);
          __pyx_t_20 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_32 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_16, __pyx_t_15);
          }
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_ErrRestore(__pyx_t_10, __pyx_t_13, __pyx_t_12);
          __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0;
          __pyx_lineno = __pyx_t_20; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_32;
          goto __pyx_L5_except_error;
        }
        __pyx_L46_return: {
          __pyx_t_15 = __pyx_r;
          __pyx_r = 0;
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          __pyx_r = __pyx_t_15;
          __pyx_t_15 = 0;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "buelon/cython/c_hub.pyx":1328
 * 
 *     def send_request(self, method, data: bytes, timeout: int | float = 5, increments: int | float | Callable = 5, attempts: int = 4):
 *         try:             # <<<<<<<<<<<<<<
 *             # socket.setdefaulttimeout(timeout)
 *             with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as conn:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "buelon/cython/c_hub.pyx":1355
 *             return self.send_request(method, data, timeout, increments, attempts - 1)
 * 
 *         return response             # <<<<<<<<<<<<<<
 *         # attempt = 0
 *         # while attempt < self.max_reconnect_attempts:
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_response)) { __Pyx_RaiseUnboundLocalError("response"); __PYX_ERR(0, 1355, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_v_response);
  __pyx_r = __pyx_v_response;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1327
 *             self.conn = None
 * 
 *     def send_request(self, method, data: bytes, timeout: int | float = 5, increments: int | float | Callable = 5, attempts: int = 4):             # <<<<<<<<<<<<<<
 *         try:
 *             # socket.setdefaulttimeout(timeout)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_31);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.send_request", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_conn);
  __Pyx_XDECREF(__pyx_v_request);
  __Pyx_XDECREF(__pyx_v_response);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_warnings);
  __Pyx_XDECREF(__pyx_v_timeout);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1374
 *         #         self.connect()  # Establish a new connection before retrying
 * 
 *     def get_steps(self, scopes, **kwargs):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_get_steps(scopes, **kwargs)
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_12get_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_scopes, PyObject *__pyx_v_kwargs) {
  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;
  unsigned int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_steps", 1);

  /* "buelon/cython/c_hub.pyx":1375
 * 
 *     def get_steps(self, scopes, **kwargs):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_get_steps(scopes, **kwargs)
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.GET_STEPS, buelon.helpers.json_parser.dumps([scopes, kwargs])))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1375, __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, 1375, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1376
 *     def get_steps(self, scopes, **kwargs):
 *         if USING_POSTGRES:
 *             return self.postgres_get_steps(scopes, **kwargs)             # <<<<<<<<<<<<<<
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.GET_STEPS, buelon.helpers.json_parser.dumps([scopes, kwargs])))
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_get_steps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_scopes);
    __Pyx_GIVEREF(__pyx_v_scopes);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_scopes)) __PYX_ERR(0, 1376, __pyx_L1_error);
    __pyx_t_4 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1376, __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_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1375
 * 
 *     def get_steps(self, scopes, **kwargs):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_get_steps(scopes, **kwargs)
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.GET_STEPS, buelon.helpers.json_parser.dumps([scopes, kwargs])))
 */
  }

  /* "buelon/cython/c_hub.pyx":1377
 *         if USING_POSTGRES:
 *             return self.postgres_get_steps(scopes, **kwargs)
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.GET_STEPS, buelon.helpers.json_parser.dumps([scopes, kwargs])))             # <<<<<<<<<<<<<<
 * 
 *     def get_rows(self, step_id):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_buelon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_helpers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_loads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_request); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Method); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_GET_STEPS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_buelon); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_helpers); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_dumps); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_v_scopes);
  __Pyx_GIVEREF(__pyx_v_scopes);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_v_scopes)) __PYX_ERR(0, 1377, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_v_kwargs);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_v_kwargs)) __PYX_ERR(0, 1377, __pyx_L1_error);
  __pyx_t_10 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_8};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __pyx_t_9 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_6};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_t_1 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1374
 *         #         self.connect()  # Establish a new connection before retrying
 * 
 *     def get_steps(self, scopes, **kwargs):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_get_steps(scopes, **kwargs)
 */

  /* 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_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.get_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1379
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.GET_STEPS, buelon.helpers.json_parser.dumps([scopes, kwargs])))
 * 
 *     def get_rows(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_get_rows(step_id)
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_14get_rows(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_rows", 1);

  /* "buelon/cython/c_hub.pyx":1380
 * 
 *     def get_rows(self, step_id):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_get_rows(step_id)
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.FETCH_ROWS, buelon.helpers.json_parser.dumps({'step_id': step_id})))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __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, 1380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1381
 *     def get_rows(self, step_id):
 *         if USING_POSTGRES:
 *             return self.postgres_get_rows(step_id)             # <<<<<<<<<<<<<<
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.FETCH_ROWS, buelon.helpers.json_parser.dumps({'step_id': step_id})))
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_get_rows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_step_id};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1381, __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;

    /* "buelon/cython/c_hub.pyx":1380
 * 
 *     def get_rows(self, step_id):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_get_rows(step_id)
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.FETCH_ROWS, buelon.helpers.json_parser.dumps({'step_id': step_id})))
 */
  }

  /* "buelon/cython/c_hub.pyx":1382
 *         if USING_POSTGRES:
 *             return self.postgres_get_rows(step_id)
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.FETCH_ROWS, buelon.helpers.json_parser.dumps({'step_id': step_id})))             # <<<<<<<<<<<<<<
 * 
 *     def done(self, step_id):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_helpers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_loads); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_request); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Method); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_FETCH_ROWS); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_buelon); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_helpers); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dumps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_step_id, __pyx_v_step_id) < 0) __PYX_ERR(0, 1382, __pyx_L1_error)
  __pyx_t_11 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9};
    __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __pyx_t_10 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_7};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_t_6 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1379
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.GET_STEPS, buelon.helpers.json_parser.dumps([scopes, kwargs])))
 * 
 *     def get_rows(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_get_rows(step_id)
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.get_rows", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1384
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.FETCH_ROWS, buelon.helpers.json_parser.dumps({'step_id': step_id})))
 * 
 *     def done(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_done(step_id)
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_16done(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 1);

  /* "buelon/cython/c_hub.pyx":1385
 * 
 *     def done(self, step_id):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_done(step_id)
 *         return self.send_request(Method.DONE, step_id.encode())
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __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, 1385, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1386
 *     def done(self, step_id):
 *         if USING_POSTGRES:
 *             return self.postgres_done(step_id)             # <<<<<<<<<<<<<<
 *         return self.send_request(Method.DONE, step_id.encode())
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_done); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_step_id};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __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;

    /* "buelon/cython/c_hub.pyx":1385
 * 
 *     def done(self, step_id):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_done(step_id)
 *         return self.send_request(Method.DONE, step_id.encode())
 */
  }

  /* "buelon/cython/c_hub.pyx":1387
 *         if USING_POSTGRES:
 *             return self.postgres_done(step_id)
 *         return self.send_request(Method.DONE, step_id.encode())             # <<<<<<<<<<<<<<
 * 
 *     def dones(self, steps: list[buelon.core.step.Step]):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_request); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Method); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_DONE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_step_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_7 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __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;

  /* "buelon/cython/c_hub.pyx":1384
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.FETCH_ROWS, buelon.helpers.json_parser.dumps({'step_id': step_id})))
 * 
 *     def done(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_done(step_id)
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1389
 *         return self.send_request(Method.DONE, step_id.encode())
 * 
 *     def dones(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_dones(steps)
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_18dones(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps) {
  PyObject *__pyx_v_step = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dones", 1);

  /* "buelon/cython/c_hub.pyx":1390
 * 
 *     def dones(self, steps: list[buelon.core.step.Step]):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_dones(steps)
 *         for step in steps:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __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, 1390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1391
 *     def dones(self, steps: list[buelon.core.step.Step]):
 *         if USING_POSTGRES:
 *             return self.postgres_dones(steps)             # <<<<<<<<<<<<<<
 *         for step in steps:
 *             self.done(step.id)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_dones); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_steps};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1391, __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;

    /* "buelon/cython/c_hub.pyx":1390
 * 
 *     def dones(self, steps: list[buelon.core.step.Step]):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_dones(steps)
 *         for step in steps:
 */
  }

  /* "buelon/cython/c_hub.pyx":1392
 *         if USING_POSTGRES:
 *             return self.postgres_dones(steps)
 *         for step in steps:             # <<<<<<<<<<<<<<
 *             self.done(step.id)
 * 
 */
  __pyx_t_1 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_6 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1392, __pyx_L1_error)
      #endif
      if (__pyx_t_6 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1392, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_step, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1393
 *             return self.postgres_dones(steps)
 *         for step in steps:
 *             self.done(step.id)             # <<<<<<<<<<<<<<
 * 
 *     def pending(self, step_id):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_done_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_step, __pyx_n_s_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1393, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1392
 *         if USING_POSTGRES:
 *             return self.postgres_dones(steps)
 *         for step in steps:             # <<<<<<<<<<<<<<
 *             self.done(step.id)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1389
 *         return self.send_request(Method.DONE, step_id.encode())
 * 
 *     def dones(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_dones(steps)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.dones", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_step);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1395
 *             self.done(step.id)
 * 
 *     def pending(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_pending(step_id)
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_20pending(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pending", 1);

  /* "buelon/cython/c_hub.pyx":1396
 * 
 *     def pending(self, step_id):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_pending(step_id)
 *         return self.send_request(Method.PENDING, step_id.encode())
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1396, __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, 1396, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1397
 *     def pending(self, step_id):
 *         if USING_POSTGRES:
 *             return self.postgres_pending(step_id)             # <<<<<<<<<<<<<<
 *         return self.send_request(Method.PENDING, step_id.encode())
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_pending); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_step_id};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __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;

    /* "buelon/cython/c_hub.pyx":1396
 * 
 *     def pending(self, step_id):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_pending(step_id)
 *         return self.send_request(Method.PENDING, step_id.encode())
 */
  }

  /* "buelon/cython/c_hub.pyx":1398
 *         if USING_POSTGRES:
 *             return self.postgres_pending(step_id)
 *         return self.send_request(Method.PENDING, step_id.encode())             # <<<<<<<<<<<<<<
 * 
 *     def pendings(self, steps: list[buelon.core.step.Step]):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_request); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Method); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PENDING); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_step_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_7 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1398, __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;

  /* "buelon/cython/c_hub.pyx":1395
 *             self.done(step.id)
 * 
 *     def pending(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_pending(step_id)
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.pending", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1400
 *         return self.send_request(Method.PENDING, step_id.encode())
 * 
 *     def pendings(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_pendings(steps)
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_22pendings(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps) {
  PyObject *__pyx_v_step = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pendings", 1);

  /* "buelon/cython/c_hub.pyx":1401
 * 
 *     def pendings(self, steps: list[buelon.core.step.Step]):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_pendings(steps)
 *         for step in steps:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __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, 1401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1402
 *     def pendings(self, steps: list[buelon.core.step.Step]):
 *         if USING_POSTGRES:
 *             return self.postgres_pendings(steps)             # <<<<<<<<<<<<<<
 *         for step in steps:
 *             self.pending(step.id)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_pendings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_steps};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1402, __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;

    /* "buelon/cython/c_hub.pyx":1401
 * 
 *     def pendings(self, steps: list[buelon.core.step.Step]):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_pendings(steps)
 *         for step in steps:
 */
  }

  /* "buelon/cython/c_hub.pyx":1403
 *         if USING_POSTGRES:
 *             return self.postgres_pendings(steps)
 *         for step in steps:             # <<<<<<<<<<<<<<
 *             self.pending(step.id)
 * 
 */
  __pyx_t_1 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_6 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1403, __pyx_L1_error)
      #endif
      if (__pyx_t_6 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1403, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_step, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1404
 *             return self.postgres_pendings(steps)
 *         for step in steps:
 *             self.pending(step.id)             # <<<<<<<<<<<<<<
 * 
 *     def cancel(self, step_id):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pending); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_step, __pyx_n_s_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1404, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1403
 *         if USING_POSTGRES:
 *             return self.postgres_pendings(steps)
 *         for step in steps:             # <<<<<<<<<<<<<<
 *             self.pending(step.id)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1400
 *         return self.send_request(Method.PENDING, step_id.encode())
 * 
 *     def pendings(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_pendings(steps)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.pendings", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_step);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1406
 *             self.pending(step.id)
 * 
 *     def cancel(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_cancel(step_id)
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_24cancel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cancel", 1);

  /* "buelon/cython/c_hub.pyx":1407
 * 
 *     def cancel(self, step_id):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_cancel(step_id)
 *         return self.send_request(Method.CANCEL, step_id.encode())
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __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, 1407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1408
 *     def cancel(self, step_id):
 *         if USING_POSTGRES:
 *             return self.postgres_cancel(step_id)             # <<<<<<<<<<<<<<
 *         return self.send_request(Method.CANCEL, step_id.encode())
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_step_id};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __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;

    /* "buelon/cython/c_hub.pyx":1407
 * 
 *     def cancel(self, step_id):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_cancel(step_id)
 *         return self.send_request(Method.CANCEL, step_id.encode())
 */
  }

  /* "buelon/cython/c_hub.pyx":1409
 *         if USING_POSTGRES:
 *             return self.postgres_cancel(step_id)
 *         return self.send_request(Method.CANCEL, step_id.encode())             # <<<<<<<<<<<<<<
 * 
 *     def cancels(self, steps: list[buelon.core.step.Step]):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_request); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Method); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_CANCEL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_step_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_7 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1409, __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;

  /* "buelon/cython/c_hub.pyx":1406
 *             self.pending(step.id)
 * 
 *     def cancel(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_cancel(step_id)
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1411
 *         return self.send_request(Method.CANCEL, step_id.encode())
 * 
 *     def cancels(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_cancels(steps)
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_26cancels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps) {
  PyObject *__pyx_v_step = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cancels", 1);

  /* "buelon/cython/c_hub.pyx":1412
 * 
 *     def cancels(self, steps: list[buelon.core.step.Step]):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_cancels(steps)
 *         for step in steps:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1412, __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, 1412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1413
 *     def cancels(self, steps: list[buelon.core.step.Step]):
 *         if USING_POSTGRES:
 *             return self.postgres_cancels(steps)             # <<<<<<<<<<<<<<
 *         for step in steps:
 *             self.cancel(step.id)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_cancels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_steps};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1413, __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;

    /* "buelon/cython/c_hub.pyx":1412
 * 
 *     def cancels(self, steps: list[buelon.core.step.Step]):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_cancels(steps)
 *         for step in steps:
 */
  }

  /* "buelon/cython/c_hub.pyx":1414
 *         if USING_POSTGRES:
 *             return self.postgres_cancels(steps)
 *         for step in steps:             # <<<<<<<<<<<<<<
 *             self.cancel(step.id)
 * 
 */
  __pyx_t_1 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_6 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1414, __pyx_L1_error)
      #endif
      if (__pyx_t_6 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1414, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1414, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_step, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1415
 *             return self.postgres_cancels(steps)
 *         for step in steps:
 *             self.cancel(step.id)             # <<<<<<<<<<<<<<
 * 
 *     def reset(self, step_id):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_step, __pyx_n_s_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1415, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1414
 *         if USING_POSTGRES:
 *             return self.postgres_cancels(steps)
 *         for step in steps:             # <<<<<<<<<<<<<<
 *             self.cancel(step.id)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1411
 *         return self.send_request(Method.CANCEL, step_id.encode())
 * 
 *     def cancels(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_cancels(steps)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.cancels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_step);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1417
 *             self.cancel(step.id)
 * 
 *     def reset(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_reset(step_id)
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_28reset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 1);

  /* "buelon/cython/c_hub.pyx":1418
 * 
 *     def reset(self, step_id):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_reset(step_id)
 *         return self.send_request(Method.RESET, step_id.encode())
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __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, 1418, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1419
 *     def reset(self, step_id):
 *         if USING_POSTGRES:
 *             return self.postgres_reset(step_id)             # <<<<<<<<<<<<<<
 *         return self.send_request(Method.RESET, step_id.encode())
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_reset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_step_id};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __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;

    /* "buelon/cython/c_hub.pyx":1418
 * 
 *     def reset(self, step_id):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_reset(step_id)
 *         return self.send_request(Method.RESET, step_id.encode())
 */
  }

  /* "buelon/cython/c_hub.pyx":1420
 *         if USING_POSTGRES:
 *             return self.postgres_reset(step_id)
 *         return self.send_request(Method.RESET, step_id.encode())             # <<<<<<<<<<<<<<
 * 
 *     def resets(self, steps: list[buelon.core.step.Step]):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_request); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Method); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_RESET); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_step_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_7 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __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;

  /* "buelon/cython/c_hub.pyx":1417
 *             self.cancel(step.id)
 * 
 *     def reset(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_reset(step_id)
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1422
 *         return self.send_request(Method.RESET, step_id.encode())
 * 
 *     def resets(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_resets(steps)
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_30resets(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps) {
  PyObject *__pyx_v_step = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("resets", 1);

  /* "buelon/cython/c_hub.pyx":1423
 * 
 *     def resets(self, steps: list[buelon.core.step.Step]):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_resets(steps)
 *         for step in steps:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __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, 1423, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1424
 *     def resets(self, steps: list[buelon.core.step.Step]):
 *         if USING_POSTGRES:
 *             return self.postgres_resets(steps)             # <<<<<<<<<<<<<<
 *         for step in steps:
 *             self.reset(step.id)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_resets); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_steps};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __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;

    /* "buelon/cython/c_hub.pyx":1423
 * 
 *     def resets(self, steps: list[buelon.core.step.Step]):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_resets(steps)
 *         for step in steps:
 */
  }

  /* "buelon/cython/c_hub.pyx":1425
 *         if USING_POSTGRES:
 *             return self.postgres_resets(steps)
 *         for step in steps:             # <<<<<<<<<<<<<<
 *             self.reset(step.id)
 * 
 */
  __pyx_t_1 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_6 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1425, __pyx_L1_error)
      #endif
      if (__pyx_t_6 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1425, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_step, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1426
 *             return self.postgres_resets(steps)
 *         for step in steps:
 *             self.reset(step.id)             # <<<<<<<<<<<<<<
 * 
 *     def error(self, step_id, msg, trace):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reset_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_step, __pyx_n_s_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1426, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1425
 *         if USING_POSTGRES:
 *             return self.postgres_resets(steps)
 *         for step in steps:             # <<<<<<<<<<<<<<
 *             self.reset(step.id)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1422
 *         return self.send_request(Method.RESET, step_id.encode())
 * 
 *     def resets(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_resets(steps)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.resets", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_step);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1428
 *             self.reset(step.id)
 * 
 *     def error(self, step_id, msg, trace):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_error(step_id, msg, trace)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_33error(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubClient_33error = {"error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubClient_33error, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_33error(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_step_id = 0;
  PyObject *__pyx_v_msg = 0;
  PyObject *__pyx_v_trace = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("error (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_step_id,&__pyx_n_s_msg,&__pyx_n_s_trace,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1428, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_id)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1428, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("error", 1, 4, 4, 1); __PYX_ERR(0, 1428, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_msg)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1428, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("error", 1, 4, 4, 2); __PYX_ERR(0, 1428, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_trace)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1428, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("error", 1, 4, 4, 3); __PYX_ERR(0, 1428, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "error") < 0)) __PYX_ERR(0, 1428, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_step_id = values[1];
    __pyx_v_msg = values[2];
    __pyx_v_trace = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("error", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 1428, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_32error(__pyx_self, __pyx_v_self, __pyx_v_step_id, __pyx_v_msg, __pyx_v_trace);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_32error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_msg, PyObject *__pyx_v_trace) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("error", 1);

  /* "buelon/cython/c_hub.pyx":1429
 * 
 *     def error(self, step_id, msg, trace):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_error(step_id, msg, trace)
 *         return self.send_request(Method.ERROR, buelon.helpers.json_parser.dumps({'step_id': step_id, 'msg': msg, 'trace': trace}))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __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, 1429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1430
 *     def error(self, step_id, msg, trace):
 *         if USING_POSTGRES:
 *             return self.postgres_error(step_id, msg, trace)             # <<<<<<<<<<<<<<
 *         return self.send_request(Method.ERROR, buelon.helpers.json_parser.dumps({'step_id': step_id, 'msg': msg, 'trace': trace}))
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_step_id, __pyx_v_msg, __pyx_v_trace};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1430, __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;

    /* "buelon/cython/c_hub.pyx":1429
 * 
 *     def error(self, step_id, msg, trace):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_error(step_id, msg, trace)
 *         return self.send_request(Method.ERROR, buelon.helpers.json_parser.dumps({'step_id': step_id, 'msg': msg, 'trace': trace}))
 */
  }

  /* "buelon/cython/c_hub.pyx":1431
 *         if USING_POSTGRES:
 *             return self.postgres_error(step_id, msg, trace)
 *         return self.send_request(Method.ERROR, buelon.helpers.json_parser.dumps({'step_id': step_id, 'msg': msg, 'trace': trace}))             # <<<<<<<<<<<<<<
 * 
 *     def upload_step(self, step_json, status_value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_request); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Method); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ERROR); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_buelon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_helpers); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dumps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_step_id, __pyx_v_step_id) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_msg, __pyx_v_msg) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_trace, __pyx_v_trace) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
  __pyx_t_9 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __pyx_t_8 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1431, __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;

  /* "buelon/cython/c_hub.pyx":1428
 *             self.reset(step.id)
 * 
 *     def error(self, step_id, msg, trace):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_error(step_id, msg, trace)
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1433
 *         return self.send_request(Method.ERROR, buelon.helpers.json_parser.dumps({'step_id': step_id, 'msg': msg, 'trace': trace}))
 * 
 *     def upload_step(self, step_json, status_value):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_upload_step(step_json, status_value)
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_34upload_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_json, PyObject *__pyx_v_status_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("upload_step", 1);

  /* "buelon/cython/c_hub.pyx":1434
 * 
 *     def upload_step(self, step_json, status_value):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_upload_step(step_json, status_value)
 *         return self.send_request(Method.UPLOAD_STEP, buelon.helpers.json_parser.dumps([step_json, status_value]))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __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, 1434, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1435
 *     def upload_step(self, step_json, status_value):
 *         if USING_POSTGRES:
 *             return self.postgres_upload_step(step_json, status_value)             # <<<<<<<<<<<<<<
 *         return self.send_request(Method.UPLOAD_STEP, buelon.helpers.json_parser.dumps([step_json, status_value]))
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_upload_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_step_json, __pyx_v_status_value};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __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;

    /* "buelon/cython/c_hub.pyx":1434
 * 
 *     def upload_step(self, step_json, status_value):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_upload_step(step_json, status_value)
 *         return self.send_request(Method.UPLOAD_STEP, buelon.helpers.json_parser.dumps([step_json, status_value]))
 */
  }

  /* "buelon/cython/c_hub.pyx":1436
 *         if USING_POSTGRES:
 *             return self.postgres_upload_step(step_json, status_value)
 *         return self.send_request(Method.UPLOAD_STEP, buelon.helpers.json_parser.dumps([step_json, status_value]))             # <<<<<<<<<<<<<<
 * 
 *     def upload_steps(self, step_jsons, status_values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_request); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Method); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_UPLOAD_STEP); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_buelon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_helpers); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dumps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_step_json);
  __Pyx_GIVEREF(__pyx_v_step_json);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_step_json)) __PYX_ERR(0, 1436, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_status_value);
  __Pyx_GIVEREF(__pyx_v_status_value);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_v_status_value)) __PYX_ERR(0, 1436, __pyx_L1_error);
  __pyx_t_9 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __pyx_t_8 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __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;

  /* "buelon/cython/c_hub.pyx":1433
 *         return self.send_request(Method.ERROR, buelon.helpers.json_parser.dumps({'step_id': step_id, 'msg': msg, 'trace': trace}))
 * 
 *     def upload_step(self, step_json, status_value):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_upload_step(step_json, status_value)
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.upload_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1438
 *         return self.send_request(Method.UPLOAD_STEP, buelon.helpers.json_parser.dumps([step_json, status_value]))
 * 
 *     def upload_steps(self, step_jsons, status_values):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_upload_steps(step_jsons, status_values)
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_36upload_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_jsons, PyObject *__pyx_v_status_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("upload_steps", 1);

  /* "buelon/cython/c_hub.pyx":1439
 * 
 *     def upload_steps(self, step_jsons, status_values):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_upload_steps(step_jsons, status_values)
 *         return self.send_request(Method.UPLOAD_STEPS, buelon.helpers.json_parser.dumps([step_jsons, status_values]))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __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, 1439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1440
 *     def upload_steps(self, step_jsons, status_values):
 *         if USING_POSTGRES:
 *             return self.postgres_upload_steps(step_jsons, status_values)             # <<<<<<<<<<<<<<
 *         return self.send_request(Method.UPLOAD_STEPS, buelon.helpers.json_parser.dumps([step_jsons, status_values]))
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_upload_steps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_step_jsons, __pyx_v_status_values};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1440, __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;

    /* "buelon/cython/c_hub.pyx":1439
 * 
 *     def upload_steps(self, step_jsons, status_values):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_upload_steps(step_jsons, status_values)
 *         return self.send_request(Method.UPLOAD_STEPS, buelon.helpers.json_parser.dumps([step_jsons, status_values]))
 */
  }

  /* "buelon/cython/c_hub.pyx":1441
 *         if USING_POSTGRES:
 *             return self.postgres_upload_steps(step_jsons, status_values)
 *         return self.send_request(Method.UPLOAD_STEPS, buelon.helpers.json_parser.dumps([step_jsons, status_values]))             # <<<<<<<<<<<<<<
 * 
 *     def get_step_count(self, types: str | None = None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_request); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Method); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_UPLOAD_STEPS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_buelon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_helpers); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dumps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_step_jsons);
  __Pyx_GIVEREF(__pyx_v_step_jsons);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_step_jsons)) __PYX_ERR(0, 1441, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_status_values);
  __Pyx_GIVEREF(__pyx_v_status_values);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_v_status_values)) __PYX_ERR(0, 1441, __pyx_L1_error);
  __pyx_t_9 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __pyx_t_8 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1441, __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;

  /* "buelon/cython/c_hub.pyx":1438
 *         return self.send_request(Method.UPLOAD_STEP, buelon.helpers.json_parser.dumps([step_json, status_value]))
 * 
 *     def upload_steps(self, step_jsons, status_values):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_upload_steps(step_jsons, status_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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.upload_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1443
 *         return self.send_request(Method.UPLOAD_STEPS, buelon.helpers.json_parser.dumps([step_jsons, status_values]))
 * 
 *     def get_step_count(self, types: str | None = None):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_get_step_count(types)
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_38get_step_count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_types) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_step_count", 1);

  /* "buelon/cython/c_hub.pyx":1444
 * 
 *     def get_step_count(self, types: str | None = None):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_get_step_count(types)
 *         return buelon.helpers.json_parser.loads(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __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, 1444, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1445
 *     def get_step_count(self, types: str | None = None):
 *         if USING_POSTGRES:
 *             return self.postgres_get_step_count(types)             # <<<<<<<<<<<<<<
 *         return buelon.helpers.json_parser.loads(
 *             self.send_request(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_get_step_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_types};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1445, __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;

    /* "buelon/cython/c_hub.pyx":1444
 * 
 *     def get_step_count(self, types: str | None = None):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_get_step_count(types)
 *         return buelon.helpers.json_parser.loads(
 */
  }

  /* "buelon/cython/c_hub.pyx":1446
 *         if USING_POSTGRES:
 *             return self.postgres_get_step_count(types)
 *         return buelon.helpers.json_parser.loads(             # <<<<<<<<<<<<<<
 *             self.send_request(
 *                 Method.STEP_COUNT,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_helpers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_loads); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":1447
 *             return self.postgres_get_step_count(types)
 *         return buelon.helpers.json_parser.loads(
 *             self.send_request(             # <<<<<<<<<<<<<<
 *                 Method.STEP_COUNT,
 *                 buelon.helpers.json_parser.dumps({'types': types}),
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_request); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "buelon/cython/c_hub.pyx":1448
 *         return buelon.helpers.json_parser.loads(
 *             self.send_request(
 *                 Method.STEP_COUNT,             # <<<<<<<<<<<<<<
 *                 buelon.helpers.json_parser.dumps({'types': types}),
 *                 timeout=60,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Method); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_STEP_COUNT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1449
 *             self.send_request(
 *                 Method.STEP_COUNT,
 *                 buelon.helpers.json_parser.dumps({'types': types}),             # <<<<<<<<<<<<<<
 *                 timeout=60,
 *                 attempts=0
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_buelon); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_helpers); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_dumps); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_types, __pyx_v_types) < 0) __PYX_ERR(0, 1449, __pyx_L1_error)
  __pyx_t_10 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_8};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }

  /* "buelon/cython/c_hub.pyx":1447
 *             return self.postgres_get_step_count(types)
 *         return buelon.helpers.json_parser.loads(
 *             self.send_request(             # <<<<<<<<<<<<<<
 *                 Method.STEP_COUNT,
 *                 buelon.helpers.json_parser.dumps({'types': types}),
 */
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7)) __PYX_ERR(0, 1447, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6)) __PYX_ERR(0, 1447, __pyx_L1_error);
  __pyx_t_7 = 0;
  __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1450
 *                 Method.STEP_COUNT,
 *                 buelon.helpers.json_parser.dumps({'types': types}),
 *                 timeout=60,             # <<<<<<<<<<<<<<
 *                 attempts=0
 *             )
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_timeout, __pyx_int_60) < 0) __PYX_ERR(0, 1450, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_attempts, __pyx_int_0) < 0) __PYX_ERR(0, 1450, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1447
 *             return self.postgres_get_step_count(types)
 *         return buelon.helpers.json_parser.loads(
 *             self.send_request(             # <<<<<<<<<<<<<<
 *                 Method.STEP_COUNT,
 *                 buelon.helpers.json_parser.dumps({'types': types}),
 */
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1443
 *         return self.send_request(Method.UPLOAD_STEPS, buelon.helpers.json_parser.dumps([step_jsons, status_values]))
 * 
 *     def get_step_count(self, types: str | None = None):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_get_step_count(types)
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.get_step_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1455
 *         )
 * 
 *     def reset_errors(self, include_workers: bool):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_reset_errors(include_workers)
 */

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

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

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

  /* "buelon/cython/c_hub.pyx":1456
 * 
 *     def reset_errors(self, include_workers: bool):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_reset_errors(include_workers)
 *         return self.send_request(Method.RESET_ERRORS, b'true' if include_workers else b'false', timeout=60 * 10, increments=30)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1456, __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, 1456, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1457
 *     def reset_errors(self, include_workers: bool):
 *         if USING_POSTGRES:
 *             return self.postgres_reset_errors(include_workers)             # <<<<<<<<<<<<<<
 *         return self.send_request(Method.RESET_ERRORS, b'true' if include_workers else b'false', timeout=60 * 10, increments=30)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_reset_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_include_workers};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1457, __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;

    /* "buelon/cython/c_hub.pyx":1456
 * 
 *     def reset_errors(self, include_workers: bool):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_reset_errors(include_workers)
 *         return self.send_request(Method.RESET_ERRORS, b'true' if include_workers else b'false', timeout=60 * 10, increments=30)
 */
  }

  /* "buelon/cython/c_hub.pyx":1458
 *         if USING_POSTGRES:
 *             return self.postgres_reset_errors(include_workers)
 *         return self.send_request(Method.RESET_ERRORS, b'true' if include_workers else b'false', timeout=60 * 10, increments=30)             # <<<<<<<<<<<<<<
 * 
 *     def delete_steps(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_request); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Method); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RESET_ERRORS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_include_workers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1458, __pyx_L1_error)
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_n_b_true);
    __pyx_t_3 = __pyx_n_b_true;
  } else {
    __Pyx_INCREF(__pyx_n_b_false);
    __pyx_t_3 = __pyx_n_b_false;
  }
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 1458, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 1458, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_timeout, __pyx_int_600) < 0) __PYX_ERR(0, 1458, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_increments, __pyx_int_30) < 0) __PYX_ERR(0, 1458, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1458, __pyx_L1_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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1455
 *         )
 * 
 *     def reset_errors(self, include_workers: bool):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_reset_errors(include_workers)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.reset_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1460
 *         return self.send_request(Method.RESET_ERRORS, b'true' if include_workers else b'false', timeout=60 * 10, increments=30)
 * 
 *     def delete_steps(self):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_delete_steps()
 */

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

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

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

  /* "buelon/cython/c_hub.pyx":1461
 * 
 *     def delete_steps(self):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_delete_steps()
 *         return self.send_request(Method.DELETE_STEPS, b'nothing')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __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, 1461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1462
 *     def delete_steps(self):
 *         if USING_POSTGRES:
 *             return self.postgres_delete_steps()             # <<<<<<<<<<<<<<
 *         return self.send_request(Method.DELETE_STEPS, b'nothing')
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_delete_steps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __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;

    /* "buelon/cython/c_hub.pyx":1461
 * 
 *     def delete_steps(self):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_delete_steps()
 *         return self.send_request(Method.DELETE_STEPS, b'nothing')
 */
  }

  /* "buelon/cython/c_hub.pyx":1463
 *         if USING_POSTGRES:
 *             return self.postgres_delete_steps()
 *         return self.send_request(Method.DELETE_STEPS, b'nothing')             # <<<<<<<<<<<<<<
 * 
 *     def fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_request); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Method); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_DELETE_STEPS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_6, __pyx_n_b_nothing};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1463, __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;

  /* "buelon/cython/c_hub.pyx":1460
 *         return self.send_request(Method.RESET_ERRORS, b'true' if include_workers else b'false', timeout=60 * 10, increments=30)
 * 
 *     def delete_steps(self):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_delete_steps()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.delete_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1465
 *         return self.send_request(Method.DELETE_STEPS, b'nothing')
 * 
 *     def fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *         """
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_45fetch_errors(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6buelon_6cython_5c_hub_9HubClient_44fetch_errors, "\n\n        Args:\n            count (int): Number of errors to fetch\n            exclude (lit[str], str, optional): Exclude errors with this string in the message. Defaults to None.\n\n        Returns:\n            dict: A dictionary containing `table`, `count`, and `total`.\n                `table` is a list of error dictionaries, each containing `id`, `msg`, and `trace`.\n        ");
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubClient_45fetch_errors = {"fetch_errors", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubClient_45fetch_errors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6buelon_6cython_5c_hub_9HubClient_44fetch_errors};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_45fetch_errors(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_count = 0;
  PyObject *__pyx_v_exclude = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fetch_errors (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_count,&__pyx_n_s_exclude,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1465, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_count)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1465, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("fetch_errors", 0, 2, 3, 1); __PYX_ERR(0, 1465, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exclude);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1465, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fetch_errors") < 0)) __PYX_ERR(0, 1465, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_count = ((PyObject*)values[1]);
    __pyx_v_exclude = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fetch_errors", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1465, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.fetch_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_count), (&PyInt_Type), 0, "count", 1))) __PYX_ERR(0, 1465, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_44fetch_errors(__pyx_self, __pyx_v_self, __pyx_v_count, __pyx_v_exclude);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_44fetch_errors(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_count, PyObject *__pyx_v_exclude) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fetch_errors", 1);

  /* "buelon/cython/c_hub.pyx":1476
 *                 `table` is a list of error dictionaries, each containing `id`, `msg`, and `trace`.
 *         """
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_fetch_errors(count, exclude)
 *         return buelon.helpers.json_parser.loads(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1476, __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, 1476, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1477
 *         """
 *         if USING_POSTGRES:
 *             return self.postgres_fetch_errors(count, exclude)             # <<<<<<<<<<<<<<
 *         return buelon.helpers.json_parser.loads(
 *             self.send_request(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_fetch_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_count, __pyx_v_exclude};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(0, 1477, __pyx_L1_error)
    __pyx_r = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1476
 *                 `table` is a list of error dictionaries, each containing `id`, `msg`, and `trace`.
 *         """
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_fetch_errors(count, exclude)
 *         return buelon.helpers.json_parser.loads(
 */
  }

  /* "buelon/cython/c_hub.pyx":1478
 *         if USING_POSTGRES:
 *             return self.postgres_fetch_errors(count, exclude)
 *         return buelon.helpers.json_parser.loads(             # <<<<<<<<<<<<<<
 *             self.send_request(
 *                 Method.FETCH_ERRORS,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_helpers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_loads); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":1479
 *             return self.postgres_fetch_errors(count, exclude)
 *         return buelon.helpers.json_parser.loads(
 *             self.send_request(             # <<<<<<<<<<<<<<
 *                 Method.FETCH_ERRORS,
 *                 buelon.helpers.json_parser.dumps({
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_send_request); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "buelon/cython/c_hub.pyx":1480
 *         return buelon.helpers.json_parser.loads(
 *             self.send_request(
 *                 Method.FETCH_ERRORS,             # <<<<<<<<<<<<<<
 *                 buelon.helpers.json_parser.dumps({
 *                     'count': count,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Method); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_FETCH_ERRORS); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1481
 *             self.send_request(
 *                 Method.FETCH_ERRORS,
 *                 buelon.helpers.json_parser.dumps({             # <<<<<<<<<<<<<<
 *                     'count': count,
 *                     'exclude': exclude
 */
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_buelon); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_helpers); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_json_parser); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dumps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "buelon/cython/c_hub.pyx":1482
 *                 Method.FETCH_ERRORS,
 *                 buelon.helpers.json_parser.dumps({
 *                     'count': count,             # <<<<<<<<<<<<<<
 *                     'exclude': exclude
 *                 })#f'{count}'.encode()
 */
  __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_count, __pyx_v_count) < 0) __PYX_ERR(0, 1482, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1483
 *                 buelon.helpers.json_parser.dumps({
 *                     'count': count,
 *                     'exclude': exclude             # <<<<<<<<<<<<<<
 *                 })#f'{count}'.encode()
 *             )
 */
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_exclude, __pyx_v_exclude) < 0) __PYX_ERR(0, 1482, __pyx_L1_error)
  __pyx_t_11 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9};
    __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __pyx_t_10 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_7};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_t_6 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "buelon/cython/c_hub.pyx":1478
 *         if USING_POSTGRES:
 *             return self.postgres_fetch_errors(count, exclude)
 *         return buelon.helpers.json_parser.loads(             # <<<<<<<<<<<<<<
 *             self.send_request(
 *                 Method.FETCH_ERRORS,
 */
  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(0, 1478, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1465
 *         return self.send_request(Method.DELETE_STEPS, b'nothing')
 * 
 *     def fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *         """
 * 
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.fetch_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1488
 *         )
 * 
 *     def repair(self):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_repair()
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_46repair(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_warnings = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("repair", 1);

  /* "buelon/cython/c_hub.pyx":1489
 * 
 *     def repair(self):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_repair()
 *         import warnings
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_USING_POSTGRES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1489, __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, 1489, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1490
 *     def repair(self):
 *         if USING_POSTGRES:
 *             return self.postgres_repair()             # <<<<<<<<<<<<<<
 *         import warnings
 *         warnings.warn('HubClient.repair() is only implemented for postgres')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_repair); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1490, __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;

    /* "buelon/cython/c_hub.pyx":1489
 * 
 *     def repair(self):
 *         if USING_POSTGRES:             # <<<<<<<<<<<<<<
 *             return self.postgres_repair()
 *         import warnings
 */
  }

  /* "buelon/cython/c_hub.pyx":1491
 *         if USING_POSTGRES:
 *             return self.postgres_repair()
 *         import warnings             # <<<<<<<<<<<<<<
 *         warnings.warn('HubClient.repair() is only implemented for postgres')
 * 
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_warnings, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_warnings = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1492
 *             return self.postgres_repair()
 *         import warnings
 *         warnings.warn('HubClient.repair() is only implemented for postgres')             # <<<<<<<<<<<<<<
 * 
 *     def load_pg(self):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_HubClient_repair_is_only_impleme};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1492, __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;

  /* "buelon/cython/c_hub.pyx":1488
 *         )
 * 
 *     def repair(self):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_repair()
 */

  /* 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_AddTraceback("buelon.cython.c_hub.HubClient.repair", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_warnings);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1494
 *         warnings.warn('HubClient.repair() is only implemented for postgres')
 * 
 *     def load_pg(self):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_48load_pg(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_q = NULL;
  PyObject *__pyx_v_qs = NULL;
  PyObject *__pyx_9genexpr20__pyx_v_e = 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;
  unsigned int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("load_pg", 1);

  /* "buelon/cython/c_hub.pyx":1495
 * 
 *     def load_pg(self):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_s_db); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1495, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  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_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1495, __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, 1495, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1496
 *     def load_pg(self):
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         q = '''create table if not exists buelon_jobs (
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_postgres); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_postgres_from_env); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1496, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_db, __pyx_t_4) < 0) __PYX_ERR(0, 1496, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1495
 * 
 *     def load_pg(self):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":1498
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         q = '''create table if not exists buelon_jobs (             # <<<<<<<<<<<<<<
 *             id text,
 *             priority int,
 */
  __Pyx_INCREF(__pyx_kp_s_create_table_if_not_exists_buelo);
  __pyx_v_q = __pyx_kp_s_create_table_if_not_exists_buelo;

  /* "buelon/cython/c_hub.pyx":1514
 *         )
 *         PARTITION BY LIST (state);'''
 *         qs = [             # <<<<<<<<<<<<<<
 *             q,
 *             'CREATE TABLE IF NOT EXISTS tags (tag text primary key, velocity real);',
 */
  __pyx_t_4 = PyList_New(10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_q);
  __Pyx_GIVEREF(__pyx_v_q);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_q)) __PYX_ERR(0, 1514, __pyx_L1_error);
  __Pyx_INCREF(__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags_2);
  __Pyx_GIVEREF(__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags_2)) __PYX_ERR(0, 1514, __pyx_L1_error);
  __Pyx_INCREF(__pyx_kp_s_create_index_if_not_exists_idx_b);
  __Pyx_GIVEREF(__pyx_kp_s_create_index_if_not_exists_idx_b);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_kp_s_create_index_if_not_exists_idx_b)) __PYX_ERR(0, 1514, __pyx_L1_error);
  __Pyx_INCREF(__pyx_kp_s_create_index_if_not_exists_idx_b_2);
  __Pyx_GIVEREF(__pyx_kp_s_create_index_if_not_exists_idx_b_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 3, __pyx_kp_s_create_index_if_not_exists_idx_b_2)) __PYX_ERR(0, 1514, __pyx_L1_error);
  __Pyx_INCREF(__pyx_kp_s_create_index_if_not_exists_idx_b_3);
  __Pyx_GIVEREF(__pyx_kp_s_create_index_if_not_exists_idx_b_3);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 4, __pyx_kp_s_create_index_if_not_exists_idx_b_3)) __PYX_ERR(0, 1514, __pyx_L1_error);
  __Pyx_INCREF(__pyx_kp_s_create_index_if_not_exists_idx_b_4);
  __Pyx_GIVEREF(__pyx_kp_s_create_index_if_not_exists_idx_b_4);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 5, __pyx_kp_s_create_index_if_not_exists_idx_b_4)) __PYX_ERR(0, 1514, __pyx_L1_error);
  __Pyx_INCREF(__pyx_kp_s_CREATE_INDEX_if_not_exists_idx_b);
  __Pyx_GIVEREF(__pyx_kp_s_CREATE_INDEX_if_not_exists_idx_b);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 6, __pyx_kp_s_CREATE_INDEX_if_not_exists_idx_b)) __PYX_ERR(0, 1514, __pyx_L1_error);
  __Pyx_INCREF(__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo);
  __Pyx_GIVEREF(__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 7, __pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo)) __PYX_ERR(0, 1514, __pyx_L1_error);
  __Pyx_INCREF(__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_2);
  __Pyx_GIVEREF(__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_2);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 8, __pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_2)) __PYX_ERR(0, 1514, __pyx_L1_error);
  __Pyx_INCREF(__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_3);
  __Pyx_GIVEREF(__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_3);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 9, __pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_3)) __PYX_ERR(0, 1514, __pyx_L1_error);
  __pyx_v_qs = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1526
 *             'CREATE TABLE IF NOT EXISTS "buelon_jobs_archived" PARTITION OF "buelon_jobs" FOR VALUES IN (\'archived\');',
 *         ]
 *         try:             # <<<<<<<<<<<<<<
 *             # for q in qs:
 *             #     self.db.query(q)
 */
  {
    __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:*/ {

      /* "buelon/cython/c_hub.pyx":1529
 *             # for q in qs:
 *             #     self.db.query(q)
 *             self.db.query(';'.join(qs))             # <<<<<<<<<<<<<<
 *             self.db.upload_table('buelon_status_map', [
 *                 {'value': e.value, 'name': e.name}
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1529, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1529, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__10, __pyx_v_qs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1529, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1529, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "buelon/cython/c_hub.pyx":1530
 *             #     self.db.query(q)
 *             self.db.query(';'.join(qs))
 *             self.db.upload_table('buelon_status_map', [             # <<<<<<<<<<<<<<
 *                 {'value': e.value, 'name': e.name}
 *                 for e in buelon.core.step.StepStatus
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1530, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_upload_table); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1530, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      { /* enter inner scope */
        __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1530, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_4);

        /* "buelon/cython/c_hub.pyx":1532
 *             self.db.upload_table('buelon_status_map', [
 *                 {'value': e.value, 'name': e.name}
 *                 for e in buelon.core.step.StepStatus             # <<<<<<<<<<<<<<
 *             ], id_column='value')
 *         except buelon.helpers.postgres.psycopg2.errors.InsufficientPrivilege:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buelon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1532, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_core); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1532, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1532, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1532, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) {
          __pyx_t_6 = __pyx_t_11; __Pyx_INCREF(__pyx_t_6);
          __pyx_t_12 = 0;
          __pyx_t_13 = NULL;
        } else {
          __pyx_t_12 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1532, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1532, __pyx_L14_error)
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        for (;;) {
          if (likely(!__pyx_t_13)) {
            if (likely(PyList_CheckExact(__pyx_t_6))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1532, __pyx_L14_error)
                #endif
                if (__pyx_t_12 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_11 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_11); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1532, __pyx_L14_error)
              #else
              __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1532, __pyx_L14_error)
              __Pyx_GOTREF(__pyx_t_11);
              #endif
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1532, __pyx_L14_error)
                #endif
                if (__pyx_t_12 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_11); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1532, __pyx_L14_error)
              #else
              __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1532, __pyx_L14_error)
              __Pyx_GOTREF(__pyx_t_11);
              #endif
            }
          } else {
            __pyx_t_11 = __pyx_t_13(__pyx_t_6);
            if (unlikely(!__pyx_t_11)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1532, __pyx_L14_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_11);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_e, __pyx_t_11);
          __pyx_t_11 = 0;

          /* "buelon/cython/c_hub.pyx":1531
 *             self.db.query(';'.join(qs))
 *             self.db.upload_table('buelon_status_map', [
 *                 {'value': e.value, 'name': e.name}             # <<<<<<<<<<<<<<
 *                 for e in buelon.core.step.StepStatus
 *             ], id_column='value')
 */
          __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1531, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr20__pyx_v_e, __pyx_n_s_value); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1531, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_14);
          if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_value, __pyx_t_14) < 0) __PYX_ERR(0, 1531, __pyx_L14_error)
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr20__pyx_v_e, __pyx_n_s_name); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1531, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_14);
          if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_name, __pyx_t_14) < 0) __PYX_ERR(0, 1531, __pyx_L14_error)
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1530, __pyx_L14_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

          /* "buelon/cython/c_hub.pyx":1532
 *             self.db.upload_table('buelon_status_map', [
 *                 {'value': e.value, 'name': e.name}
 *                 for e in buelon.core.step.StepStatus             # <<<<<<<<<<<<<<
 *             ], id_column='value')
 *         except buelon.helpers.postgres.psycopg2.errors.InsufficientPrivilege:
 */
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_e); __pyx_9genexpr20__pyx_v_e = 0;
        goto __pyx_L18_exit_scope;
        __pyx_L14_error:;
        __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_e); __pyx_9genexpr20__pyx_v_e = 0;
        goto __pyx_L6_error;
        __pyx_L18_exit_scope:;
      } /* exit inner scope */

      /* "buelon/cython/c_hub.pyx":1530
 *             #     self.db.query(q)
 *             self.db.query(';'.join(qs))
 *             self.db.upload_table('buelon_status_map', [             # <<<<<<<<<<<<<<
 *                 {'value': e.value, 'name': e.name}
 *                 for e in buelon.core.step.StepStatus
 */
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1530, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_n_s_buelon_status_map);
      __Pyx_GIVEREF(__pyx_n_s_buelon_status_map);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_buelon_status_map)) __PYX_ERR(0, 1530, __pyx_L6_error);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 1530, __pyx_L6_error);
      __pyx_t_4 = 0;

      /* "buelon/cython/c_hub.pyx":1533
 *                 {'value': e.value, 'name': e.name}
 *                 for e in buelon.core.step.StepStatus
 *             ], id_column='value')             # <<<<<<<<<<<<<<
 *         except buelon.helpers.postgres.psycopg2.errors.InsufficientPrivilege:
 *             print('Insufficient privileges to create table.')
 */
      __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1533, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_id_column, __pyx_n_s_value) < 0) __PYX_ERR(0, 1533, __pyx_L6_error)

      /* "buelon/cython/c_hub.pyx":1530
 *             #     self.db.query(q)
 *             self.db.query(';'.join(qs))
 *             self.db.upload_table('buelon_status_map', [             # <<<<<<<<<<<<<<
 *                 {'value': e.value, 'name': e.name}
 *                 for e in buelon.core.step.StepStatus
 */
      __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1530, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "buelon/cython/c_hub.pyx":1526
 *             'CREATE TABLE IF NOT EXISTS "buelon_jobs_archived" PARTITION OF "buelon_jobs" FOR VALUES IN (\'archived\');',
 *         ]
 *         try:             # <<<<<<<<<<<<<<
 *             # for q in qs:
 *             #     self.db.query(q)
 */
    }
    __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_L11_try_end;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "buelon/cython/c_hub.pyx":1534
 *                 for e in buelon.core.step.StepStatus
 *             ], id_column='value')
 *         except buelon.helpers.postgres.psycopg2.errors.InsufficientPrivilege:             # <<<<<<<<<<<<<<
 *             print('Insufficient privileges to create table.')
 * 
 */
    __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_4, &__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1534, __pyx_L8_except_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1534, __pyx_L8_except_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_postgres); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1534, __pyx_L8_except_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_psycopg2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1534, __pyx_L8_except_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_errors); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1534, __pyx_L8_except_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_InsufficientPrivilege); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1534, __pyx_L8_except_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_15 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_11, __pyx_t_14);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_ErrRestore(__pyx_t_11, __pyx_t_4, __pyx_t_6);
    __pyx_t_11 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0;
    if (__pyx_t_15) {
      __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.load_pg", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_11) < 0) __PYX_ERR(0, 1534, __pyx_L8_except_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_11);

      /* "buelon/cython/c_hub.pyx":1535
 *             ], id_column='value')
 *         except buelon.helpers.postgres.psycopg2.errors.InsufficientPrivilege:
 *             print('Insufficient privileges to create table.')             # <<<<<<<<<<<<<<
 * 
 *     def postgres_get_steps(
 */
      __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1535, __pyx_L8_except_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L7_exception_handled;
    }
    goto __pyx_L8_except_error;

    /* "buelon/cython/c_hub.pyx":1526
 *             'CREATE TABLE IF NOT EXISTS "buelon_jobs_archived" PARTITION OF "buelon_jobs" FOR VALUES IN (\'archived\');',
 *         ]
 *         try:             # <<<<<<<<<<<<<<
 *             # for q in qs:
 *             #     self.db.query(q)
 */
    __pyx_L8_except_error:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L7_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    __pyx_L11_try_end:;
  }

  /* "buelon/cython/c_hub.pyx":1494
 *         warnings.warn('HubClient.repair() is only implemented for postgres')
 * 
 *     def load_pg(self):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.load_pg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_q);
  __Pyx_XDECREF(__pyx_v_qs);
  __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1537
 *             print('Insufficient privileges to create table.')
 * 
 *     def postgres_get_steps(             # <<<<<<<<<<<<<<
 *             self,
 *             scopes: list[str],
 */

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

  /* "buelon/cython/c_hub.pyx":1544
 *             status=buelon.core.step.StepStatus.pending.value,
 *             include_working=True,
 *             reverse=False,             # <<<<<<<<<<<<<<
 *             min_table_size: int = 2000
 *     ) -> list[str]:
 */
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_int_100));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_100));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_int_100))) __PYX_ERR(0, 1537, __pyx_L1_error);
  __Pyx_INCREF(((PyObject *)__pyx_int_100));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_100));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_int_100))) __PYX_ERR(0, 1537, __pyx_L1_error);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_status);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_status);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_status)) __PYX_ERR(0, 1537, __pyx_L1_error);
  __Pyx_INCREF(((PyObject *)Py_True));
  __Pyx_GIVEREF(((PyObject *)Py_True));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_True))) __PYX_ERR(0, 1537, __pyx_L1_error);
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_False))) __PYX_ERR(0, 1537, __pyx_L1_error);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_min_table_size);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_min_table_size);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 5, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_min_table_size)) __PYX_ERR(0, 1537, __pyx_L1_error);

  /* "buelon/cython/c_hub.pyx":1537
 *             print('Insufficient privileges to create table.')
 * 
 *     def postgres_get_steps(             # <<<<<<<<<<<<<<
 *             self,
 *             scopes: list[str],
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1537, __pyx_L1_error);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1537, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_51postgres_get_steps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_6buelon_6cython_5c_hub_9HubClient_50postgres_get_steps, "\n        Get the steps in the scope, ordered by priority, velocity, then scope position.\n\n        Args:\n            scopes (list): A list of scopes to filter the steps.\n            limit (int): The maximum number of steps to retrieve. Defaults to 50.\n            chunk_size (int): The number of steps to fetch in each chunk. Defaults to 100.\n            status (int | buelon.core.step.StepStatus.value): The status of the steps to retrieve. Defaults to pending.\n            include_working (bool): Whether to include working steps. Defaults to True.\n            reverse (bool): Whether to reverse the order of the steps. Defaults to False.\n\n        Returns:\n            list: A list of steps ordered by priority, velocity, and scope position.\n        ");
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubClient_51postgres_get_steps = {"postgres_get_steps", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubClient_51postgres_get_steps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6buelon_6cython_5c_hub_9HubClient_50postgres_get_steps};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_51postgres_get_steps(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_scopes = 0;
  PyObject *__pyx_v_limit = 0;
  CYTHON_UNUSED PyObject *__pyx_v_chunk_size = 0;
  CYTHON_UNUSED PyObject *__pyx_v_status = 0;
  PyObject *__pyx_v_include_working = 0;
  PyObject *__pyx_v_reverse = 0;
  PyObject *__pyx_v_min_table_size = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("postgres_get_steps (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_scopes,&__pyx_n_s_limit,&__pyx_n_s_chunk_size,&__pyx_n_s_status,&__pyx_n_s_include_working,&__pyx_n_s_reverse,&__pyx_n_s_min_table_size,0};
    __pyx_defaults4 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self);
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_100)));
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_100)));
    values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_status);
    values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True)));
    values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
    values[7] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_min_table_size);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1537, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scopes)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1537, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("postgres_get_steps", 0, 2, 8, 1); __PYX_ERR(0, 1537, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_limit);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1537, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_chunk_size);
          if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1537, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_status);
          if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1537, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_include_working);
          if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1537, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reverse);
          if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1537, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_min_table_size);
          if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1537, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "postgres_get_steps") < 0)) __PYX_ERR(0, 1537, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_scopes = ((PyObject*)values[1]);
    __pyx_v_limit = values[2];
    __pyx_v_chunk_size = values[3];
    __pyx_v_status = values[4];
    __pyx_v_include_working = values[5];
    __pyx_v_reverse = values[6];
    __pyx_v_min_table_size = ((PyObject*)values[7]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("postgres_get_steps", 0, 2, 8, __pyx_nargs); __PYX_ERR(0, 1537, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_get_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scopes), (&PyList_Type), 0, "scopes", 1))) __PYX_ERR(0, 1539, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_min_table_size), (&PyInt_Type), 0, "min_table_size", 1))) __PYX_ERR(0, 1545, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_50postgres_get_steps(__pyx_self, __pyx_v_self, __pyx_v_scopes, __pyx_v_limit, __pyx_v_chunk_size, __pyx_v_status, __pyx_v_include_working, __pyx_v_reverse, __pyx_v_min_table_size);

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

/* "buelon/cython/c_hub.pyx":1637
 *         rows = self.db.download_table(sql=query)
 * 
 *         def check_active_state(min_table_size, scope_section, working_clause, order_by):             # <<<<<<<<<<<<<<
 *             db = buelon.helpers.postgres.get_postgres_from_env()
 *             row = db.download_table(sql=f'select count(*) as amount, min(priority) as priority from buelon_jobs_active where status != \'{buelon.core.step.StepStatus.working.value}\';')[0]
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_1check_active_state(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_1check_active_state = {"check_active_state", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_1check_active_state, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_1check_active_state(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_min_table_size = 0;
  PyObject *__pyx_v_scope_section = 0;
  PyObject *__pyx_v_working_clause = 0;
  PyObject *__pyx_v_order_by = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_active_state (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_min_table_size,&__pyx_n_s_scope_section,&__pyx_n_s_working_clause,&__pyx_n_s_order_by,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_min_table_size)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1637, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_scope_section)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1637, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("check_active_state", 1, 4, 4, 1); __PYX_ERR(0, 1637, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_working_clause)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1637, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("check_active_state", 1, 4, 4, 2); __PYX_ERR(0, 1637, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_order_by)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1637, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("check_active_state", 1, 4, 4, 3); __PYX_ERR(0, 1637, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "check_active_state") < 0)) __PYX_ERR(0, 1637, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
    }
    __pyx_v_min_table_size = values[0];
    __pyx_v_scope_section = values[1];
    __pyx_v_working_clause = values[2];
    __pyx_v_order_by = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("check_active_state", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 1637, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_get_steps.check_active_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_check_active_state(__pyx_self, __pyx_v_min_table_size, __pyx_v_scope_section, __pyx_v_working_clause, __pyx_v_order_by);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_check_active_state(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_min_table_size, PyObject *__pyx_v_scope_section, PyObject *__pyx_v_working_clause, PyObject *__pyx_v_order_by) {
  PyObject *__pyx_v_db = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_v_amount = NULL;
  PyObject *__pyx_v_priority = NULL;
  PyObject *__pyx_v_waiting_priority = NULL;
  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;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_active_state", 1);

  /* "buelon/cython/c_hub.pyx":1638
 * 
 *         def check_active_state(min_table_size, scope_section, working_clause, order_by):
 *             db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 *             row = db.download_table(sql=f'select count(*) as amount, min(priority) as priority from buelon_jobs_active where status != \'{buelon.core.step.StepStatus.working.value}\';')[0]
 *             amount = row['amount']
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_helpers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_postgres); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1638, __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_get_postgres_from_env); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_db = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1639
 *         def check_active_state(min_table_size, scope_section, working_clause, order_by):
 *             db = buelon.helpers.postgres.get_postgres_from_env()
 *             row = db.download_table(sql=f'select count(*) as amount, min(priority) as priority from buelon_jobs_active where status != \'{buelon.core.step.StepStatus.working.value}\';')[0]             # <<<<<<<<<<<<<<
 *             amount = row['amount']
 *             priority = row['priority']  # waiting
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_db, __pyx_n_s_download_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;
  __Pyx_INCREF(__pyx_kp_u_select_count_as_amount_min_prior);
  __pyx_t_5 += 94;
  __Pyx_GIVEREF(__pyx_kp_u_select_count_as_amount_min_prior);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_select_count_as_amount_min_prior);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_buelon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_core); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_step); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_working); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__16);
  __pyx_t_5 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__16);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__16);
  __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_sql, __pyx_t_7) < 0) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_row = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":1640
 *             db = buelon.helpers.postgres.get_postgres_from_env()
 *             row = db.download_table(sql=f'select count(*) as amount, min(priority) as priority from buelon_jobs_active where status != \'{buelon.core.step.StepStatus.working.value}\';')[0]
 *             amount = row['amount']             # <<<<<<<<<<<<<<
 *             priority = row['priority']  # waiting
 *             row = db.download_table(sql=f'select max(priority) as priority from buelon_jobs_waiting;')[0]
 */
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_amount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_amount = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":1641
 *             row = db.download_table(sql=f'select count(*) as amount, min(priority) as priority from buelon_jobs_active where status != \'{buelon.core.step.StepStatus.working.value}\';')[0]
 *             amount = row['amount']
 *             priority = row['priority']  # waiting             # <<<<<<<<<<<<<<
 *             row = db.download_table(sql=f'select max(priority) as priority from buelon_jobs_waiting;')[0]
 *             waiting_priority = row['priority']
 */
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_priority); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_priority = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":1642
 *             amount = row['amount']
 *             priority = row['priority']  # waiting
 *             row = db.download_table(sql=f'select max(priority) as priority from buelon_jobs_waiting;')[0]             # <<<<<<<<<<<<<<
 *             waiting_priority = row['priority']
 *             if amount < min_table_size or priority < waiting_priority:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_db, __pyx_n_s_download_table); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_sql, __pyx_kp_u_select_max_priority_as_priority) < 0) __PYX_ERR(0, 1642, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_row, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1643
 *             priority = row['priority']  # waiting
 *             row = db.download_table(sql=f'select max(priority) as priority from buelon_jobs_waiting;')[0]
 *             waiting_priority = row['priority']             # <<<<<<<<<<<<<<
 *             if amount < min_table_size or priority < waiting_priority:
 *                 query = f"""
 */
  __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_priority); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v_waiting_priority = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1644
 *             row = db.download_table(sql=f'select max(priority) as priority from buelon_jobs_waiting;')[0]
 *             waiting_priority = row['priority']
 *             if amount < min_table_size or priority < waiting_priority:             # <<<<<<<<<<<<<<
 *                 query = f"""
 *                 UPDATE buelon_jobs s
 */
  __pyx_t_7 = PyObject_RichCompare(__pyx_v_amount, __pyx_v_min_table_size, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1644, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!__pyx_t_10) {
  } else {
    __pyx_t_9 = __pyx_t_10;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = PyObject_RichCompare(__pyx_v_priority, __pyx_v_waiting_priority, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1644, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = __pyx_t_10;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_9) {

    /* "buelon/cython/c_hub.pyx":1645
 *             waiting_priority = row['priority']
 *             if amount < min_table_size or priority < waiting_priority:
 *                 query = f"""             # <<<<<<<<<<<<<<
 *                 UPDATE buelon_jobs s
 *                 SET state = 'active'
 */
    __pyx_t_7 = PyTuple_New(11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_UPDATE_buelon_jobs_s_SET_state);
    __pyx_t_5 += 204;
    __Pyx_GIVEREF(__pyx_kp_u_UPDATE_buelon_jobs_s_SET_state);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_u_UPDATE_buelon_jobs_s_SET_state);
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_scope_section, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_AND_s_status_2);
    __pyx_t_5 += 38;
    __Pyx_GIVEREF(__pyx_kp_u_AND_s_status_2);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u_AND_s_status_2);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_buelon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pending); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u__31);
    __pyx_t_5 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__31);
    PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_kp_u__31);
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_working_clause, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_ORDER_BY_3);
    __pyx_t_5 += 31;
    __Pyx_GIVEREF(__pyx_kp_u_ORDER_BY_3);
    PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_kp_u_ORDER_BY_3);
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_order_by, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_LIMIT_3);
    __pyx_t_5 += 27;
    __Pyx_GIVEREF(__pyx_kp_u_LIMIT_3);
    PyTuple_SET_ITEM(__pyx_t_7, 8, __pyx_kp_u_LIMIT_3);
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_min_table_size, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_7, 9, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_FOR_UPDATE_SKIP_LOCKED);
    __pyx_t_5 += 62;
    __Pyx_GIVEREF(__pyx_kp_u_FOR_UPDATE_SKIP_LOCKED);
    PyTuple_SET_ITEM(__pyx_t_7, 10, __pyx_kp_u_FOR_UPDATE_SKIP_LOCKED);
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_7, 11, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_query = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1657
 *                     FOR UPDATE SKIP LOCKED
 *                 );"""
 *                 db.query(query)             # <<<<<<<<<<<<<<
 * 
 *         thread = threading.Thread(
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_db, __pyx_n_s_query); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_query};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "buelon/cython/c_hub.pyx":1644
 *             row = db.download_table(sql=f'select max(priority) as priority from buelon_jobs_waiting;')[0]
 *             waiting_priority = row['priority']
 *             if amount < min_table_size or priority < waiting_priority:             # <<<<<<<<<<<<<<
 *                 query = f"""
 *                 UPDATE buelon_jobs s
 */
  }

  /* "buelon/cython/c_hub.pyx":1637
 *         rows = self.db.download_table(sql=query)
 * 
 *         def check_active_state(min_table_size, scope_section, working_clause, order_by):             # <<<<<<<<<<<<<<
 *             db = buelon.helpers.postgres.get_postgres_from_env()
 *             row = db.download_table(sql=f'select count(*) as amount, min(priority) as priority from buelon_jobs_active where status != \'{buelon.core.step.StepStatus.working.value}\';')[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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_get_steps.check_active_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_db);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_amount);
  __Pyx_XDECREF(__pyx_v_priority);
  __Pyx_XDECREF(__pyx_v_waiting_priority);
  __Pyx_XDECREF(__pyx_v_query);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_4generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1615
 *             # scope_section = f"""s.scope IN ({','.join(f"'{s}'" for s in scopes)})"""
 *             # same as above
 *             scope_section = f"""s.scope = ANY(array[{','.join(f"'{s}'" for s in scopes)}])"""             # <<<<<<<<<<<<<<
 * 
 *         query = f"""
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_2genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1615, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_4generator8, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubClient_postgres_get_steps_loc, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_get_steps.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_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_4generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1615, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1615, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1615, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1615, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__8);
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_s, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__8);
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1615, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1537
 *             print('Insufficient privileges to create table.')
 * 
 *     def postgres_get_steps(             # <<<<<<<<<<<<<<
 *             self,
 *             scopes: list[str],
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_50postgres_get_steps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_scopes, PyObject *__pyx_v_limit, CYTHON_UNUSED PyObject *__pyx_v_chunk_size, CYTHON_UNUSED PyObject *__pyx_v_status, PyObject *__pyx_v_include_working, PyObject *__pyx_v_reverse, PyObject *__pyx_v_min_table_size) {
  PyObject *__pyx_v_expiration_time = NULL;
  PyObject *__pyx_v_working_clause = NULL;
  PyObject *__pyx_v_order_by = NULL;
  PyObject *__pyx_v_scope_section = NULL;
  PyObject *__pyx_v_query = NULL;
  PyObject *__pyx_v_rows = NULL;
  PyObject *__pyx_v_check_active_state = 0;
  PyObject *__pyx_v_thread = NULL;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_4generator8 = 0;
  PyObject *__pyx_9genexpr22__pyx_v_row = 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;
  unsigned int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_get_steps", 1);

  /* "buelon/cython/c_hub.pyx":1561
 *             list: A list of steps ordered by priority, velocity, and scope position.
 *         """
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_s_db); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1561, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  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_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1561, __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, 1561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1562
 *         """
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         # expiration_time = time.time() - (60 * 60 * .2)  # (60 * 60 * 2)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_postgres); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_postgres_from_env); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_db, __pyx_t_4) < 0) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1561
 *             list: A list of steps ordered by priority, velocity, and scope position.
 *         """
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":1600
 *         # """
 * 
 *         expiration_time = time.time() - (60 * 60 * 0.2)  # (60 * 60 * 2)             # <<<<<<<<<<<<<<
 * 
 *         working_clause = ''
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = PyFloat_FromDouble((3600.0 * 0.2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_expiration_time = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1602
 *         expiration_time = time.time() - (60 * 60 * 0.2)  # (60 * 60 * 2)
 * 
 *         working_clause = ''             # <<<<<<<<<<<<<<
 *         if include_working:
 *             # working_clause = f"OR (epoch < {expiration_time} AND status = '{buelon.core.step.StepStatus.working.value}')"
 */
  __Pyx_INCREF(__pyx_kp_s__3);
  __pyx_v_working_clause = __pyx_kp_s__3;

  /* "buelon/cython/c_hub.pyx":1603
 * 
 *         working_clause = ''
 *         if include_working:             # <<<<<<<<<<<<<<
 *             # working_clause = f"OR (epoch < {expiration_time} AND status = '{buelon.core.step.StepStatus.working.value}')"
 *             working_clause = f"OR (epoch < coalesce(timeout, {expiration_time}) AND status = '{buelon.core.step.StepStatus.working.value}')"
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_include_working); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1603, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1605
 *         if include_working:
 *             # working_clause = f"OR (epoch < {expiration_time} AND status = '{buelon.core.step.StepStatus.working.value}')"
 *             working_clause = f"OR (epoch < coalesce(timeout, {expiration_time}) AND status = '{buelon.core.step.StepStatus.working.value}')"             # <<<<<<<<<<<<<<
 * 
 *         order_by = 'priority DESC, epoch' if not reverse else 'priority ASC, epoch'
 */
    __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_OR_epoch_coalesce_timeout);
    __pyx_t_8 += 30;
    __Pyx_GIVEREF(__pyx_kp_u_OR_epoch_coalesce_timeout);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_OR_epoch_coalesce_timeout);
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_expiration_time, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u_AND_status_2);
    __pyx_t_8 += 16;
    __Pyx_GIVEREF(__pyx_kp_u_AND_status_2);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_AND_status_2);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_working); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__44);
    __pyx_t_8 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__44);
    PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u__44);
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_6, 5, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_working_clause, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1603
 * 
 *         working_clause = ''
 *         if include_working:             # <<<<<<<<<<<<<<
 *             # working_clause = f"OR (epoch < {expiration_time} AND status = '{buelon.core.step.StepStatus.working.value}')"
 *             working_clause = f"OR (epoch < coalesce(timeout, {expiration_time}) AND status = '{buelon.core.step.StepStatus.working.value}')"
 */
  }

  /* "buelon/cython/c_hub.pyx":1607
 *             working_clause = f"OR (epoch < coalesce(timeout, {expiration_time}) AND status = '{buelon.core.step.StepStatus.working.value}')"
 * 
 *         order_by = 'priority DESC, epoch' if not reverse else 'priority ASC, epoch'             # <<<<<<<<<<<<<<
 * 
 *         # scope_section = "s.scope = %s" if len(scopes) == 1 else "s.scope = ANY(%s)"
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_reverse); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1607, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_kp_s_priority_DESC_epoch);
    __pyx_t_5 = __pyx_kp_s_priority_DESC_epoch;
  } else {
    __Pyx_INCREF(__pyx_kp_s_priority_ASC_epoch);
    __pyx_t_5 = __pyx_kp_s_priority_ASC_epoch;
  }
  __pyx_v_order_by = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "buelon/cython/c_hub.pyx":1610
 * 
 *         # scope_section = "s.scope = %s" if len(scopes) == 1 else "s.scope = ANY(%s)"
 *         if len(scopes) == 1:             # <<<<<<<<<<<<<<
 *             scope_section = f"s.scope = '{scopes[0]}'"
 *         else:
 */
  __pyx_t_8 = __Pyx_PyList_GET_SIZE(__pyx_v_scopes); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1610, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_8 == 1);
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1611
 *         # scope_section = "s.scope = %s" if len(scopes) == 1 else "s.scope = ANY(%s)"
 *         if len(scopes) == 1:
 *             scope_section = f"s.scope = '{scopes[0]}'"             # <<<<<<<<<<<<<<
 *         else:
 *             # scope_section = f"""s.scope IN ({','.join(f"'{s}'" for s in scopes)})"""
 */
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_s_scope);
    __pyx_t_8 += 11;
    __Pyx_GIVEREF(__pyx_kp_u_s_scope);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_s_scope);
    __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_scopes, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_8 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__8);
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_scope_section = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1610
 * 
 *         # scope_section = "s.scope = %s" if len(scopes) == 1 else "s.scope = ANY(%s)"
 *         if len(scopes) == 1:             # <<<<<<<<<<<<<<
 *             scope_section = f"s.scope = '{scopes[0]}'"
 *         else:
 */
    goto __pyx_L7;
  }

  /* "buelon/cython/c_hub.pyx":1615
 *             # scope_section = f"""s.scope IN ({','.join(f"'{s}'" for s in scopes)})"""
 *             # same as above
 *             scope_section = f"""s.scope = ANY(array[{','.join(f"'{s}'" for s in scopes)}])"""             # <<<<<<<<<<<<<<
 * 
 *         query = f"""
 */
  /*else*/ {
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_s_scope_ANY_array);
    __pyx_t_8 += 20;
    __Pyx_GIVEREF(__pyx_kp_u_s_scope_ANY_array);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_s_scope_ANY_array);
    __pyx_t_5 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_2genexpr(NULL, __pyx_v_scopes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__15, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__45);
    __pyx_t_8 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__45);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__45);
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_scope_section = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
  }
  __pyx_L7:;

  /* "buelon/cython/c_hub.pyx":1617
 *             scope_section = f"""s.scope = ANY(array[{','.join(f"'{s}'" for s in scopes)}])"""
 * 
 *         query = f"""             # <<<<<<<<<<<<<<
 *         WITH updated_jobs AS (
 *             UPDATE buelon_jobs_active s
 */
  __pyx_t_5 = PyTuple_New(15); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = 0;
  __pyx_t_9 = 127;
  __Pyx_INCREF(__pyx_kp_u_WITH_updated_jobs_AS_UPDATE_bue);
  __pyx_t_8 += 98;
  __Pyx_GIVEREF(__pyx_kp_u_WITH_updated_jobs_AS_UPDATE_bue);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_WITH_updated_jobs_AS_UPDATE_bue);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_buelon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_working); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_epoch);
  __pyx_t_8 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_epoch);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_epoch);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_time); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_WHERE_s_id_IN_SELECT_s_id_FROM);
  __pyx_t_8 += 121;
  __Pyx_GIVEREF(__pyx_kp_u_WHERE_s_id_IN_SELECT_s_id_FROM);
  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u_WHERE_s_id_IN_SELECT_s_id_FROM);
  __Pyx_INCREF(__pyx_v_scope_section);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_scope_section) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_scope_section) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_scope_section);
  __Pyx_GIVEREF(__pyx_v_scope_section);
  PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_v_scope_section);
  __Pyx_INCREF(__pyx_kp_u_AND_s_status_3);
  __pyx_t_8 += 34;
  __Pyx_GIVEREF(__pyx_kp_u_AND_s_status_3);
  PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_kp_u_AND_s_status_3);
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_buelon); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_step); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pending); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_5, 7, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_8 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_5, 8, __pyx_kp_u__31);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_working_clause, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_5, 9, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_ORDER_BY_4);
  __pyx_t_8 += 27;
  __Pyx_GIVEREF(__pyx_kp_u_ORDER_BY_4);
  PyTuple_SET_ITEM(__pyx_t_5, 10, __pyx_kp_u_ORDER_BY_4);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_order_by, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_5, 11, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_LIMIT_4);
  __pyx_t_8 += 23;
  __Pyx_GIVEREF(__pyx_kp_u_LIMIT_4);
  PyTuple_SET_ITEM(__pyx_t_5, 12, __pyx_kp_u_LIMIT_4);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_limit, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_5, 13, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_FOR_UPDATE_SKIP_LOCKED_RETURNIN);
  __pyx_t_8 += 132;
  __Pyx_GIVEREF(__pyx_kp_u_FOR_UPDATE_SKIP_LOCKED_RETURNIN);
  PyTuple_SET_ITEM(__pyx_t_5, 14, __pyx_kp_u_FOR_UPDATE_SKIP_LOCKED_RETURNIN);
  __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_5, 15, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_query = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "buelon/cython/c_hub.pyx":1635
 *         """
 * 
 *         rows = self.db.download_table(sql=query)             # <<<<<<<<<<<<<<
 * 
 *         def check_active_state(min_table_size, scope_section, working_clause, order_by):
 */
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_download_table); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_sql, __pyx_v_query) < 0) __PYX_ERR(0, 1635, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_rows = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1637
 *         rows = self.db.download_table(sql=query)
 * 
 *         def check_active_state(min_table_size, scope_section, working_clause, order_by):             # <<<<<<<<<<<<<<
 *             db = buelon.helpers.postgres.get_postgres_from_env()
 *             row = db.download_table(sql=f'select count(*) as amount, min(priority) as priority from buelon_jobs_active where status != \'{buelon.core.step.StepStatus.working.value}\';')[0]
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_1check_active_state, 0, __pyx_n_s_HubClient_postgres_get_steps_loc_2, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_check_active_state = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1659
 *                 db.query(query)
 * 
 *         thread = threading.Thread(             # <<<<<<<<<<<<<<
 *             target=check_active_state,
 *             args=(min_table_size, scope_section, working_clause, order_by)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_threading); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Thread); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1660
 * 
 *         thread = threading.Thread(
 *             target=check_active_state,             # <<<<<<<<<<<<<<
 *             args=(min_table_size, scope_section, working_clause, order_by)
 *         )
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_target, __pyx_v_check_active_state) < 0) __PYX_ERR(0, 1660, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1661
 *         thread = threading.Thread(
 *             target=check_active_state,
 *             args=(min_table_size, scope_section, working_clause, order_by)             # <<<<<<<<<<<<<<
 *         )
 *         thread.start()
 */
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_min_table_size);
  __Pyx_GIVEREF(__pyx_v_min_table_size);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_min_table_size)) __PYX_ERR(0, 1661, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_scope_section);
  __Pyx_GIVEREF(__pyx_v_scope_section);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_scope_section)) __PYX_ERR(0, 1661, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_working_clause);
  __Pyx_GIVEREF(__pyx_v_working_clause);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_working_clause)) __PYX_ERR(0, 1661, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_order_by);
  __Pyx_GIVEREF(__pyx_v_order_by);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_order_by)) __PYX_ERR(0, 1661, __pyx_L1_error);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_args, __pyx_t_5) < 0) __PYX_ERR(0, 1660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "buelon/cython/c_hub.pyx":1659
 *                 db.query(query)
 * 
 *         thread = threading.Thread(             # <<<<<<<<<<<<<<
 *             target=check_active_state,
 *             args=(min_table_size, scope_section, working_clause, order_by)
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_thread = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "buelon/cython/c_hub.pyx":1663
 *             args=(min_table_size, scope_section, working_clause, order_by)
 *         )
 *         thread.start()             # <<<<<<<<<<<<<<
 * 
 *         return [row['id'] for row in rows]
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_thread, __pyx_n_s_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "buelon/cython/c_hub.pyx":1665
 *         thread.start()
 * 
 *         return [row['id'] for row in rows]             # <<<<<<<<<<<<<<
 * 
 *     def postgres_get_rows(self, step_id):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1665, __pyx_L10_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (likely(PyList_CheckExact(__pyx_v_rows)) || PyTuple_CheckExact(__pyx_v_rows)) {
      __pyx_t_4 = __pyx_v_rows; __Pyx_INCREF(__pyx_t_4);
      __pyx_t_8 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1665, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1665, __pyx_L10_error)
    }
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1665, __pyx_L10_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1665, __pyx_L10_error)
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1665, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1665, __pyx_L10_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1665, __pyx_L10_error)
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1665, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_11(__pyx_t_4);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1665, __pyx_L10_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_row, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_9genexpr22__pyx_v_row, __pyx_n_s_id); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1665, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1665, __pyx_L10_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_row); __pyx_9genexpr22__pyx_v_row = 0;
    goto __pyx_L14_exit_scope;
    __pyx_L10_error:;
    __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_row); __pyx_9genexpr22__pyx_v_row = 0;
    goto __pyx_L1_error;
    __pyx_L14_exit_scope:;
  } /* exit inner scope */
  __pyx_r = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1537
 *             print('Insufficient privileges to create table.')
 * 
 *     def postgres_get_steps(             # <<<<<<<<<<<<<<
 *             self,
 *             scopes: list[str],
 */

  /* 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_10);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_get_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_expiration_time);
  __Pyx_XDECREF(__pyx_v_working_clause);
  __Pyx_XDECREF(__pyx_v_order_by);
  __Pyx_XDECREF(__pyx_v_scope_section);
  __Pyx_XDECREF(__pyx_v_query);
  __Pyx_XDECREF(__pyx_v_rows);
  __Pyx_XDECREF(__pyx_v_check_active_state);
  __Pyx_XDECREF(__pyx_v_thread);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubClient_18postgres_get_steps_4generator8);
  __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1667
 *         return [row['id'] for row in rows]
 * 
 *     def postgres_get_rows(self, step_id):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_52postgres_get_rows(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_v_table = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_9genexpr23__pyx_v_s = NULL;
  PyObject *__pyx_9genexpr23__pyx_v_row = 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;
  unsigned int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  Py_UCS4 __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_get_rows", 1);

  /* "buelon/cython/c_hub.pyx":1668
 * 
 *     def postgres_get_rows(self, step_id):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_s_db); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1668, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  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_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1668, __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, 1668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1669
 *     def postgres_get_rows(self, step_id):
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         if ',' in step_id:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_postgres); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_postgres_from_env); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1669, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_db, __pyx_t_4) < 0) __PYX_ERR(0, 1669, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1668
 * 
 *     def postgres_get_rows(self, step_id):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":1671
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         if ',' in step_id:             # <<<<<<<<<<<<<<
 *             return [
 *                 row
 */
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__15, __pyx_v_step_id, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1671, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1672
 * 
 *         if ',' in step_id:
 *             return [             # <<<<<<<<<<<<<<
 *                 row
 *                 for s in step_id.split(',')
 */
    __Pyx_XDECREF(__pyx_r);
    { /* enter inner scope */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1672, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "buelon/cython/c_hub.pyx":1674
 *             return [
 *                 row
 *                 for s in step_id.split(',')             # <<<<<<<<<<<<<<
 *                 for row in self.postgres_get_rows(s.strip())
 *             ]
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_step_id, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1674, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_kp_s__15};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1674, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
        __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5);
        __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1674, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1674, __pyx_L9_error)
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1674, __pyx_L9_error)
              #endif
              if (__pyx_t_9 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1674, __pyx_L9_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1674, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1674, __pyx_L9_error)
              #endif
              if (__pyx_t_9 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1674, __pyx_L9_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1674, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_10(__pyx_t_5);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1674, __pyx_L9_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_s, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "buelon/cython/c_hub.pyx":1675
 *                 row
 *                 for s in step_id.split(',')
 *                 for row in self.postgres_get_rows(s.strip())             # <<<<<<<<<<<<<<
 *             ]
 * 
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_get_rows); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1675, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr23__pyx_v_s, __pyx_n_s_strip); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1675, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
          __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1675, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __pyx_t_12 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_11};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1675, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
          __pyx_t_8 = __pyx_t_6; __Pyx_INCREF(__pyx_t_8);
          __pyx_t_14 = 0;
          __pyx_t_15 = NULL;
        } else {
          __pyx_t_14 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1675, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1675, __pyx_L9_error)
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        for (;;) {
          if (likely(!__pyx_t_15)) {
            if (likely(PyList_CheckExact(__pyx_t_8))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1675, __pyx_L9_error)
                #endif
                if (__pyx_t_14 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_14); __Pyx_INCREF(__pyx_t_6); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 1675, __pyx_L9_error)
              #else
              __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1675, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1675, __pyx_L9_error)
                #endif
                if (__pyx_t_14 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_14); __Pyx_INCREF(__pyx_t_6); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 1675, __pyx_L9_error)
              #else
              __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1675, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_6);
              #endif
            }
          } else {
            __pyx_t_6 = __pyx_t_15(__pyx_t_8);
            if (unlikely(!__pyx_t_6)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1675, __pyx_L9_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_row, __pyx_t_6);
          __pyx_t_6 = 0;

          /* "buelon/cython/c_hub.pyx":1673
 *         if ',' in step_id:
 *             return [
 *                 row             # <<<<<<<<<<<<<<
 *                 for s in step_id.split(',')
 *                 for row in self.postgres_get_rows(s.strip())
 */
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr23__pyx_v_row))) __PYX_ERR(0, 1672, __pyx_L9_error)

          /* "buelon/cython/c_hub.pyx":1675
 *                 row
 *                 for s in step_id.split(',')
 *                 for row in self.postgres_get_rows(s.strip())             # <<<<<<<<<<<<<<
 *             ]
 * 
 */
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "buelon/cython/c_hub.pyx":1674
 *             return [
 *                 row
 *                 for s in step_id.split(',')             # <<<<<<<<<<<<<<
 *                 for row in self.postgres_get_rows(s.strip())
 *             ]
 */
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_row); __pyx_9genexpr23__pyx_v_row = 0;
      __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_s); __pyx_9genexpr23__pyx_v_s = 0;
      goto __pyx_L16_exit_scope;
      __pyx_L9_error:;
      __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_row); __pyx_9genexpr23__pyx_v_row = 0;
      __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_s); __pyx_9genexpr23__pyx_v_s = 0;
      goto __pyx_L1_error;
      __pyx_L16_exit_scope:;
    } /* exit inner scope */
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "buelon/cython/c_hub.pyx":1671
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         if ',' in step_id:             # <<<<<<<<<<<<<<
 *             return [
 *                 row
 */
  }

  /* "buelon/cython/c_hub.pyx":1678
 *             ]
 * 
 *         table = self.db.download_table(sql=f"SELECT * FROM buelon_jobs WHERE id = '{step_id}';")             # <<<<<<<<<<<<<<
 * 
 *         for row in table:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_download_table); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 0;
  __pyx_t_16 = 127;
  __Pyx_INCREF(__pyx_kp_u_SELECT_FROM_buelon_jobs_WHERE_id);
  __pyx_t_9 += 38;
  __Pyx_GIVEREF(__pyx_kp_u_SELECT_FROM_buelon_jobs_WHERE_id);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_kp_u_SELECT_FROM_buelon_jobs_WHERE_id);
  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_step_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_16;
  __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_INCREF(__pyx_kp_u__16);
  __pyx_t_9 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__16);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_u__16);
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_8, 3, __pyx_t_9, __pyx_t_16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_sql, __pyx_t_6) < 0) __PYX_ERR(0, 1678, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_table = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1680
 *         table = self.db.download_table(sql=f"SELECT * FROM buelon_jobs WHERE id = '{step_id}';")
 * 
 *         for row in table:             # <<<<<<<<<<<<<<
 *             row['status'] = buelon.core.step.StepStatus(int(row['status'])).name
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_table)) || PyTuple_CheckExact(__pyx_v_table)) {
    __pyx_t_6 = __pyx_v_table; __Pyx_INCREF(__pyx_t_6);
    __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_table); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1680, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1680, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1680, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1680, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1680, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1680, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1680, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_10(__pyx_t_6);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1680, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1681
 * 
 *         for row in table:
 *             row['status'] = buelon.core.step.StepStatus(int(row['status'])).name             # <<<<<<<<<<<<<<
 * 
 *         return table
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_status); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_11};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely((PyObject_SetItem(__pyx_v_row, __pyx_n_s_status, __pyx_t_8) < 0))) __PYX_ERR(0, 1681, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "buelon/cython/c_hub.pyx":1680
 *         table = self.db.download_table(sql=f"SELECT * FROM buelon_jobs WHERE id = '{step_id}';")
 * 
 *         for row in table:             # <<<<<<<<<<<<<<
 *             row['status'] = buelon.core.step.StepStatus(int(row['status'])).name
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1683
 *             row['status'] = buelon.core.step.StepStatus(int(row['status'])).name
 * 
 *         return table             # <<<<<<<<<<<<<<
 * 
 *     def postgres_done(self, step_id):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_table);
  __pyx_r = __pyx_v_table;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1667
 *         return [row['id'] for row in rows]
 * 
 *     def postgres_get_rows(self, step_id):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_get_rows", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_s);
  __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1685
 *         return table
 * 
 *     def postgres_done(self, step_id):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

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

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_13postgres_done_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1697
 *             end = f" id = '{_step.children[0]}'" \
 *                 if len(_step.children) == 1 else \
 *                 f' id IN (' + ', '.join(f"'{_id}'" for _id in _step.children) + ')'             # <<<<<<<<<<<<<<
 *             # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'active\' WHERE {end}")
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_13postgres_done_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1697, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubClient_13postgres_done_2generator9, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubClient_postgres_done_locals_g, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_done.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_6buelon_6cython_5c_hub_9HubClient_13postgres_done_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1697, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1697, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1697, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1697, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1697, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1697, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1697, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1697, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1697, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1697, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v__id);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__id, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_5 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u__8);
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v__id, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_5 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__8);
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1697, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1685
 *         return table
 * 
 *     def postgres_done(self, step_id):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_54postgres_done(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_v__step = NULL;
  PyObject *__pyx_v_status = NULL;
  PyObject *__pyx_v_end = NULL;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_13postgres_done_2generator9 = 0;
  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;
  unsigned int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_done", 1);

  /* "buelon/cython/c_hub.pyx":1686
 * 
 *     def postgres_done(self, step_id):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_s_db); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1686, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  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_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1686, __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, 1686, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1687
 *     def postgres_done(self, step_id):
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         _step = get_step(step_id)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_postgres); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_postgres_from_env); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_db, __pyx_t_4) < 0) __PYX_ERR(0, 1687, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1686
 * 
 *     def postgres_done(self, step_id):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":1689
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         _step = get_step(step_id)             # <<<<<<<<<<<<<<
 *         status = buelon.core.step.StepStatus.success.value
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE id = '{_step.id}'")
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_get_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_step_id};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_v__step = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1690
 * 
 *         _step = get_step(step_id)
 *         status = buelon.core.step.StepStatus.success.value             # <<<<<<<<<<<<<<
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE id = '{_step.id}'")
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_buelon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_success); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_status = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1691
 *         _step = get_step(step_id)
 *         status = buelon.core.step.StepStatus.success.value
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE id = '{_step.id}'")             # <<<<<<<<<<<<<<
 * 
 *         if _step.children:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = 0;
  __pyx_t_9 = 127;
  __Pyx_INCREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_8 += 33;
  __Pyx_GIVEREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_epoch);
  __pyx_t_8 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_epoch);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_epoch);
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_12);
  __pyx_t_12 = 0;
  __Pyx_INCREF(__pyx_kp_u_state_archived_WHERE_id);
  __pyx_t_8 += 31;
  __Pyx_GIVEREF(__pyx_kp_u_state_archived_WHERE_id);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_state_archived_WHERE_id);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_id); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_12, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u__8);
  __pyx_t_8 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__8);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_kp_u__8);
  __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_4, 7, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1693
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE id = '{_step.id}'")
 * 
 *         if _step.children:             # <<<<<<<<<<<<<<
 *             status = buelon.core.step.StepStatus.pending.value
 *             end = f" id = '{_step.children[0]}'" \
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1693, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1694
 * 
 *         if _step.children:
 *             status = buelon.core.step.StepStatus.pending.value             # <<<<<<<<<<<<<<
 *             end = f" id = '{_step.children[0]}'" \
 *                 if len(_step.children) == 1 else \
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buelon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_core); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pending); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_status, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1696
 *             status = buelon.core.step.StepStatus.pending.value
 *             end = f" id = '{_step.children[0]}'" \
 *                 if len(_step.children) == 1 else \             # <<<<<<<<<<<<<<
 *                 f' id IN (' + ', '.join(f"'{_id}'" for _id in _step.children) + ')'
 *             # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'active\' WHERE {end}")
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1696, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_1 = (__pyx_t_8 == 1);
    if (__pyx_t_1) {

      /* "buelon/cython/c_hub.pyx":1695
 *         if _step.children:
 *             status = buelon.core.step.StepStatus.pending.value
 *             end = f" id = '{_step.children[0]}'" \             # <<<<<<<<<<<<<<
 *                 if len(_step.children) == 1 else \
 *                 f' id IN (' + ', '.join(f"'{_id}'" for _id in _step.children) + ')'
 */
      __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __Pyx_INCREF(__pyx_kp_u_id_2);
      __pyx_t_8 += 7;
      __Pyx_GIVEREF(__pyx_kp_u_id_2);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_id_2);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_INCREF(__pyx_kp_u__8);
      __pyx_t_8 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__8);
      PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__8);
      __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_5 = __pyx_t_10;
      __pyx_t_10 = 0;
    } else {

      /* "buelon/cython/c_hub.pyx":1697
 *             end = f" id = '{_step.children[0]}'" \
 *                 if len(_step.children) == 1 else \
 *                 f' id IN (' + ', '.join(f"'{_id}'" for _id in _step.children) + ')'             # <<<<<<<<<<<<<<
 *             # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'active\' WHERE {end}")
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_13postgres_done_genexpr(NULL, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Add(__pyx_kp_u_id_IN, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_6, __pyx_kp_s__23); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_5 = __pyx_t_10;
      __pyx_t_10 = 0;
    }
    __pyx_v_end = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1699
 *                 f' id IN (' + ', '.join(f"'{_id}'" for _id in _step.children) + ')'
 *             # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'active\' WHERE {end}")
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")             # <<<<<<<<<<<<<<
 * 
 *     def postgres_dones(self, steps: list[buelon.core.step.Step]):
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_query); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyTuple_New(6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
    __pyx_t_8 += 33;
    __Pyx_GIVEREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_u_UPDATE_buelon_jobs_SET_status);
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_kp_u_epoch);
    __pyx_t_8 += 11;
    __Pyx_GIVEREF(__pyx_kp_u_epoch);
    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_kp_u_epoch);
    __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_time); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1699, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_11);
    __pyx_t_11 = 0;
    __Pyx_INCREF(__pyx_kp_u_state_waiting_WHERE);
    __pyx_t_8 += 24;
    __Pyx_GIVEREF(__pyx_kp_u_state_waiting_WHERE);
    PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_kp_u_state_waiting_WHERE);
    __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_end); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_11);
    __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 6, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1699, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1693
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE id = '{_step.id}'")
 * 
 *         if _step.children:             # <<<<<<<<<<<<<<
 *             status = buelon.core.step.StepStatus.pending.value
 *             end = f" id = '{_step.children[0]}'" \
 */
  }

  /* "buelon/cython/c_hub.pyx":1685
 *         return table
 * 
 *     def postgres_done(self, step_id):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__step);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubClient_13postgres_done_2generator9);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1701
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 * 
 *     def postgres_dones(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

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

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1711
 * 
 *         status = buelon.core.step.StepStatus.success.value
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'             # <<<<<<<<<<<<<<
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE {where}")
 *         children = [c for s in steps for c in s.children]
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1711, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_2generator10, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubClient_postgres_dones_locals, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1711, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_dones.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_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1711, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1711, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1711, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1711, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__8);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_id); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__8);
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1711, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_5generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1718
 *             end = f" id = '{children[0]}'" \
 *                 if len(children) == 1 else \
 *                 f' id IN (' + ', '.join(f"'{_id}'" for _id in children) + ')'             # <<<<<<<<<<<<<<
 *             # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'active\' WHERE {end}")
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1718, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_5generator11, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubClient_postgres_dones_locals, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1718, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_dones.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_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_5generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1718, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1718, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1718, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1718, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v__id);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__id, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__8);
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v__id, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__8);
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1718, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1701
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 * 
 *     def postgres_dones(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_56postgres_dones(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps) {
  PyObject *__pyx_v_status = NULL;
  PyObject *__pyx_v_where = NULL;
  PyObject *__pyx_v_children = NULL;
  PyObject *__pyx_v_end = NULL;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_2generator10 = 0;
  PyObject *__pyx_9genexpr26__pyx_v_s = NULL;
  PyObject *__pyx_9genexpr26__pyx_v_c = NULL;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_5generator11 = 0;
  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;
  unsigned int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __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 *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_dones", 1);

  /* "buelon/cython/c_hub.pyx":1702
 * 
 *     def postgres_dones(self, steps: list[buelon.core.step.Step]):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_s_db); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1702, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  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_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1702, __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, 1702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1703
 *     def postgres_dones(self, steps: list[buelon.core.step.Step]):
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         # with db.connect() as conn:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_postgres); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_postgres_from_env); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_db, __pyx_t_4) < 0) __PYX_ERR(0, 1703, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1702
 * 
 *     def postgres_dones(self, steps: list[buelon.core.step.Step]):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":1710
 *         #     conn.commit()
 * 
 *         status = buelon.core.step.StepStatus.success.value             # <<<<<<<<<<<<<<
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE {where}")
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_buelon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_success); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_status = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1711
 * 
 *         status = buelon.core.step.StepStatus.success.value
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'             # <<<<<<<<<<<<<<
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE {where}")
 *         children = [c for s in steps for c in s.children]
 */
  __pyx_t_6 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_genexpr(NULL, __pyx_v_steps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_kp_s_id_in, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__23); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_where = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1712
 *         status = buelon.core.step.StepStatus.success.value
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE {where}")             # <<<<<<<<<<<<<<
 *         children = [c for s in steps for c in s.children]
 *         if children:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = 0;
  __pyx_t_9 = 127;
  __Pyx_INCREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_8 += 33;
  __Pyx_GIVEREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_epoch);
  __pyx_t_8 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_epoch);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_epoch);
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_12);
  __pyx_t_12 = 0;
  __Pyx_INCREF(__pyx_kp_u_state_archived_WHERE);
  __pyx_t_8 += 25;
  __Pyx_GIVEREF(__pyx_kp_u_state_archived_WHERE);
  PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u_state_archived_WHERE);
  __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_v_where, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_6, 6, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_12};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1713
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE {where}")
 *         children = [c for s in steps for c in s.children]             # <<<<<<<<<<<<<<
 *         if children:
 *             status = buelon.core.step.StepStatus.pending.value
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1713, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_5);
    __pyx_t_8 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1713, __pyx_L8_error)
        #endif
        if (__pyx_t_8 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_12 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1713, __pyx_L8_error)
      #else
      __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1713, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_12);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr26__pyx_v_s, __pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr26__pyx_v_s, __pyx_n_s_children); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1713, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) {
        __pyx_t_6 = __pyx_t_12; __Pyx_INCREF(__pyx_t_6);
        __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
      } else {
        __pyx_t_13 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1713, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1713, __pyx_L8_error)
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      for (;;) {
        if (likely(!__pyx_t_14)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1713, __pyx_L8_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_12 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_12); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1713, __pyx_L8_error)
            #else
            __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1713, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_12);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1713, __pyx_L8_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_12); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1713, __pyx_L8_error)
            #else
            __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1713, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_12);
            #endif
          }
        } else {
          __pyx_t_12 = __pyx_t_14(__pyx_t_6);
          if (unlikely(!__pyx_t_12)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1713, __pyx_L8_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_12);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr26__pyx_v_c, __pyx_t_12);
        __pyx_t_12 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr26__pyx_v_c))) __PYX_ERR(0, 1713, __pyx_L8_error)
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_c); __pyx_9genexpr26__pyx_v_c = 0;
    __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_s); __pyx_9genexpr26__pyx_v_s = 0;
    goto __pyx_L15_exit_scope;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_c); __pyx_9genexpr26__pyx_v_c = 0;
    __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_s); __pyx_9genexpr26__pyx_v_s = 0;
    goto __pyx_L1_error;
    __pyx_L15_exit_scope:;
  } /* exit inner scope */
  __pyx_v_children = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1714
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE {where}")
 *         children = [c for s in steps for c in s.children]
 *         if children:             # <<<<<<<<<<<<<<
 *             status = buelon.core.step.StepStatus.pending.value
 *             end = f" id = '{children[0]}'" \
 */
  __pyx_t_1 = (PyList_GET_SIZE(__pyx_v_children) != 0);
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1715
 *         children = [c for s in steps for c in s.children]
 *         if children:
 *             status = buelon.core.step.StepStatus.pending.value             # <<<<<<<<<<<<<<
 *             end = f" id = '{children[0]}'" \
 *                 if len(children) == 1 else \
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_buelon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_core); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pending); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_status, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1717
 *             status = buelon.core.step.StepStatus.pending.value
 *             end = f" id = '{children[0]}'" \
 *                 if len(children) == 1 else \             # <<<<<<<<<<<<<<
 *                 f' id IN (' + ', '.join(f"'{_id}'" for _id in children) + ')'
 *             # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'active\' WHERE {end}")
 */
    __pyx_t_8 = __Pyx_PyList_GET_SIZE(__pyx_v_children); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1717, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_8 == 1);
    if (__pyx_t_1) {

      /* "buelon/cython/c_hub.pyx":1716
 *         if children:
 *             status = buelon.core.step.StepStatus.pending.value
 *             end = f" id = '{children[0]}'" \             # <<<<<<<<<<<<<<
 *                 if len(children) == 1 else \
 *                 f' id IN (' + ', '.join(f"'{_id}'" for _id in children) + ')'
 */
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __Pyx_INCREF(__pyx_kp_u_id_2);
      __pyx_t_8 += 7;
      __Pyx_GIVEREF(__pyx_kp_u_id_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_id_2);
      __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_children, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_12);
      __pyx_t_12 = 0;
      __Pyx_INCREF(__pyx_kp_u__8);
      __pyx_t_8 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__8);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__8);
      __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __pyx_t_12;
      __pyx_t_12 = 0;
    } else {

      /* "buelon/cython/c_hub.pyx":1718
 *             end = f" id = '{children[0]}'" \
 *                 if len(children) == 1 else \
 *                 f' id IN (' + ', '.join(f"'{_id}'" for _id in children) + ')'             # <<<<<<<<<<<<<<
 *             # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'active\' WHERE {end}")
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 */
      __pyx_t_12 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_3genexpr(NULL, __pyx_v_children); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyNumber_Add(__pyx_kp_u_id_IN, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_12, __pyx_kp_s__23); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_5 = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __pyx_v_end = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1720
 *                 f' id IN (' + ', '.join(f"'{_id}'" for _id in children) + ')'
 *             # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'active\' WHERE {end}")
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")             # <<<<<<<<<<<<<<
 * 
 *     def postgres_pending(self, step_id):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_query); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
    __pyx_t_8 += 33;
    __Pyx_GIVEREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_UPDATE_buelon_jobs_SET_status);
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u_epoch);
    __pyx_t_8 += 11;
    __Pyx_GIVEREF(__pyx_kp_u_epoch);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_epoch);
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_time); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_time); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_11);
    __pyx_t_11 = 0;
    __Pyx_INCREF(__pyx_kp_u_state_waiting_WHERE);
    __pyx_t_8 += 24;
    __Pyx_GIVEREF(__pyx_kp_u_state_waiting_WHERE);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_state_waiting_WHERE);
    __pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_end); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_11);
    __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_4, 6, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1714
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE {where}")
 *         children = [c for s in steps for c in s.children]
 *         if children:             # <<<<<<<<<<<<<<
 *             status = buelon.core.step.StepStatus.pending.value
 *             end = f" id = '{children[0]}'" \
 */
  }

  /* "buelon/cython/c_hub.pyx":1701
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 * 
 *     def postgres_dones(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_dones", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XDECREF(__pyx_v_where);
  __Pyx_XDECREF(__pyx_v_children);
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_2generator10);
  __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_s);
  __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_c);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubClient_14postgres_dones_5generator11);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1722
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 * 
 *     def postgres_pending(self, step_id):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_58postgres_pending(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id) {
  PyObject *__pyx_v_status = 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;
  unsigned int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_pending", 1);

  /* "buelon/cython/c_hub.pyx":1723
 * 
 *     def postgres_pending(self, step_id):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_s_db); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1723, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  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_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1723, __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, 1723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1724
 *     def postgres_pending(self, step_id):
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         status = buelon.core.step.StepStatus.pending.value
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_postgres); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_postgres_from_env); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1724, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_db, __pyx_t_4) < 0) __PYX_ERR(0, 1724, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1723
 * 
 *     def postgres_pending(self, step_id):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":1726
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         status = buelon.core.step.StepStatus.pending.value             # <<<<<<<<<<<<<<
 *         # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'active\' WHERE id = '{step_id}';")
 *         self.db.query(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_buelon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pending); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_status = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1728
 *         status = buelon.core.step.StepStatus.pending.value
 *         # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'active\' WHERE id = '{step_id}';")
 *         self.db.query(             # <<<<<<<<<<<<<<
 *             f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE id = '{step_id}';")
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1729
 *         # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'active\' WHERE id = '{step_id}';")
 *         self.db.query(
 *             f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE id = '{step_id}';")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = 0;
  __pyx_t_9 = 127;
  __Pyx_INCREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_8 += 33;
  __Pyx_GIVEREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_epoch);
  __pyx_t_8 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_epoch);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_epoch);
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_12);
  __pyx_t_12 = 0;
  __Pyx_INCREF(__pyx_kp_u_state_waiting_WHERE_id);
  __pyx_t_8 += 30;
  __Pyx_GIVEREF(__pyx_kp_u_state_waiting_WHERE_id);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_state_waiting_WHERE_id);
  __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_v_step_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_12);
  __pyx_t_12 = 0;
  __Pyx_INCREF(__pyx_kp_u__16);
  __pyx_t_8 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__16);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_kp_u__16);
  __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_4, 7, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_12};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1722
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 * 
 *     def postgres_pending(self, step_id):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_pending", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1732
 * 
 * 
 *     def postgres_pendings(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

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

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_17postgres_pendings_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1738
 *         status = buelon.core.step.StepStatus.pending.value
 * 
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'             # <<<<<<<<<<<<<<
 *         self.db.query(
 *             f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where};")
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_17postgres_pendings_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1738, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubClient_17postgres_pendings_2generator12, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubClient_postgres_pendings_loca, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1738, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_pendings.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_6buelon_6cython_5c_hub_9HubClient_17postgres_pendings_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1738, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1738, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1738, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1738, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__8);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_id); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__8);
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1738, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1732
 * 
 * 
 *     def postgres_pendings(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_60postgres_pendings(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps) {
  PyObject *__pyx_v_status = NULL;
  PyObject *__pyx_v_where = NULL;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_17postgres_pendings_2generator12 = 0;
  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;
  unsigned int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_pendings", 1);

  /* "buelon/cython/c_hub.pyx":1733
 * 
 *     def postgres_pendings(self, steps: list[buelon.core.step.Step]):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_s_db); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1733, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  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_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1733, __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, 1733, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1734
 *     def postgres_pendings(self, steps: list[buelon.core.step.Step]):
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         status = buelon.core.step.StepStatus.pending.value
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_postgres); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_postgres_from_env); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1734, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_db, __pyx_t_4) < 0) __PYX_ERR(0, 1734, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1733
 * 
 *     def postgres_pendings(self, steps: list[buelon.core.step.Step]):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":1736
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         status = buelon.core.step.StepStatus.pending.value             # <<<<<<<<<<<<<<
 * 
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_buelon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pending); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_status = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1738
 *         status = buelon.core.step.StepStatus.pending.value
 * 
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'             # <<<<<<<<<<<<<<
 *         self.db.query(
 *             f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where};")
 */
  __pyx_t_6 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_17postgres_pendings_genexpr(NULL, __pyx_v_steps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_kp_s_id_in, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_s__23); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_where = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1739
 * 
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'
 *         self.db.query(             # <<<<<<<<<<<<<<
 *             f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where};")
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1740
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'
 *         self.db.query(
 *             f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where};")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = 0;
  __pyx_t_9 = 127;
  __Pyx_INCREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_8 += 33;
  __Pyx_GIVEREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_epoch);
  __pyx_t_8 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_epoch);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_epoch);
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_12);
  __pyx_t_12 = 0;
  __Pyx_INCREF(__pyx_kp_u_state_waiting_WHERE);
  __pyx_t_8 += 24;
  __Pyx_GIVEREF(__pyx_kp_u_state_waiting_WHERE);
  PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u_state_waiting_WHERE);
  __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_v_where, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_12);
  __pyx_t_12 = 0;
  __Pyx_INCREF(__pyx_kp_u__10);
  __pyx_t_8 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__10);
  PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_kp_u__10);
  __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_6, 7, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_12};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1732
 * 
 * 
 *     def postgres_pendings(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_pendings", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XDECREF(__pyx_v_where);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubClient_17postgres_pendings_2generator12);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1743
 * 
 * 
 *     def postgres_cancel(self, step_id: str, __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_63postgres_cancel(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubClient_63postgres_cancel = {"postgres_cancel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubClient_63postgres_cancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_63postgres_cancel(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_step_id = 0;
  PyObject *__pyx_v__HubClient__already = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("postgres_cancel (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_step_id,&__pyx_n_s_HubClient__already,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1743, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_id)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1743, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("postgres_cancel", 0, 2, 3, 1); __PYX_ERR(0, 1743, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_HubClient__already);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1743, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "postgres_cancel") < 0)) __PYX_ERR(0, 1743, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_step_id = ((PyObject*)values[1]);
    __pyx_v__HubClient__already = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("postgres_cancel", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1743, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_step_id), (&PyString_Type), 0, "step_id", 1))) __PYX_ERR(0, 1743, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_62postgres_cancel(__pyx_self, __pyx_v_self, __pyx_v_step_id, __pyx_v__HubClient__already);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_62postgres_cancel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v__HubClient__already) {
  PyObject *__pyx_v_first_iteration = NULL;
  PyObject *__pyx_v__step = NULL;
  PyObject *__pyx_v_status = NULL;
  PyObject *__pyx_v_parent = NULL;
  PyObject *__pyx_v_child = 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;
  unsigned int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_cancel", 0);
  __Pyx_INCREF(__pyx_v__HubClient__already);

  /* "buelon/cython/c_hub.pyx":1744
 * 
 *     def postgres_cancel(self, step_id: str, __already: set | None = None):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_s_db); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1744, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  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_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1744, __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, 1744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1745
 *     def postgres_cancel(self, step_id: str, __already: set | None = None):
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         first_iteration = __already is None
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_postgres); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_postgres_from_env); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1745, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_db, __pyx_t_4) < 0) __PYX_ERR(0, 1745, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1744
 * 
 *     def postgres_cancel(self, step_id: str, __already: set | None = None):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":1747
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         first_iteration = __already is None             # <<<<<<<<<<<<<<
 *         _step = get_step(step_id)
 *         __already = set() if first_iteration else __already
 */
  __pyx_t_1 = (__pyx_v__HubClient__already == Py_None);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_first_iteration = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1748
 * 
 *         first_iteration = __already is None
 *         _step = get_step(step_id)             # <<<<<<<<<<<<<<
 *         __already = set() if first_iteration else __already
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_get_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_step_id};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_v__step = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1749
 *         first_iteration = __already is None
 *         _step = get_step(step_id)
 *         __already = set() if first_iteration else __already             # <<<<<<<<<<<<<<
 * 
 *         status = buelon.core.step.StepStatus.cancel.value
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_first_iteration); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1749, __pyx_L1_error)
  if (__pyx_t_1) {
    __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __pyx_t_6;
    __pyx_t_6 = 0;
  } else {
    __Pyx_INCREF(__pyx_v__HubClient__already);
    __pyx_t_4 = __pyx_v__HubClient__already;
  }
  __Pyx_DECREF_SET(__pyx_v__HubClient__already, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1751
 *         __already = set() if first_iteration else __already
 * 
 *         status = buelon.core.step.StepStatus.cancel.value             # <<<<<<<<<<<<<<
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE id = '{_step.id}'")
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_buelon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_cancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_status = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1752
 * 
 *         status = buelon.core.step.StepStatus.cancel.value
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE id = '{_step.id}'")             # <<<<<<<<<<<<<<
 * 
 *         if _step.parents:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = 0;
  __pyx_t_9 = 127;
  __Pyx_INCREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_8 += 33;
  __Pyx_GIVEREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_epoch);
  __pyx_t_8 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_epoch);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_epoch);
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1752, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_12);
  __pyx_t_12 = 0;
  __Pyx_INCREF(__pyx_kp_u_state_archived_WHERE_id);
  __pyx_t_8 += 31;
  __Pyx_GIVEREF(__pyx_kp_u_state_archived_WHERE_id);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_state_archived_WHERE_id);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_id); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_12, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u__8);
  __pyx_t_8 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__8);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_kp_u__8);
  __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_4, 7, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1752, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1754
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE id = '{_step.id}'")
 * 
 *         if _step.parents:             # <<<<<<<<<<<<<<
 *             for parent in _step.parents:
 *                 if parent not in __already:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_parents); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1755
 * 
 *         if _step.parents:
 *             for parent in _step.parents:             # <<<<<<<<<<<<<<
 *                 if parent not in __already:
 *                     __already.add(parent)
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_parents); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_8 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1755, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1755, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1755, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1755, __pyx_L1_error)
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1755, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1755, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1755, __pyx_L1_error)
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1755, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_13(__pyx_t_5);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1755, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_parent, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "buelon/cython/c_hub.pyx":1756
 *         if _step.parents:
 *             for parent in _step.parents:
 *                 if parent not in __already:             # <<<<<<<<<<<<<<
 *                     __already.add(parent)
 *                     self.postgres_cancel(parent, __already)
 */
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_parent, __pyx_v__HubClient__already, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1756, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "buelon/cython/c_hub.pyx":1757
 *             for parent in _step.parents:
 *                 if parent not in __already:
 *                     __already.add(parent)             # <<<<<<<<<<<<<<
 *                     self.postgres_cancel(parent, __already)
 * 
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v__HubClient__already, __pyx_n_s_add); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1757, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_4 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_parent};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1757, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "buelon/cython/c_hub.pyx":1758
 *                 if parent not in __already:
 *                     __already.add(parent)
 *                     self.postgres_cancel(parent, __already)             # <<<<<<<<<<<<<<
 * 
 *         if _step.children:
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_cancel); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1758, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_4 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_parent, __pyx_v__HubClient__already};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1758, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "buelon/cython/c_hub.pyx":1756
 *         if _step.parents:
 *             for parent in _step.parents:
 *                 if parent not in __already:             # <<<<<<<<<<<<<<
 *                     __already.add(parent)
 *                     self.postgres_cancel(parent, __already)
 */
      }

      /* "buelon/cython/c_hub.pyx":1755
 * 
 *         if _step.parents:
 *             for parent in _step.parents:             # <<<<<<<<<<<<<<
 *                 if parent not in __already:
 *                     __already.add(parent)
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1754
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE id = '{_step.id}'")
 * 
 *         if _step.parents:             # <<<<<<<<<<<<<<
 *             for parent in _step.parents:
 *                 if parent not in __already:
 */
  }

  /* "buelon/cython/c_hub.pyx":1760
 *                     self.postgres_cancel(parent, __already)
 * 
 *         if _step.children:             # <<<<<<<<<<<<<<
 *             for child in _step.children:
 *                 if child not in __already:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1760, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1761
 * 
 *         if _step.children:
 *             for child in _step.children:             # <<<<<<<<<<<<<<
 *                 if child not in __already:
 *                     __already.add(child)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1761, __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_8 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1761, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1761, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1761, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1761, __pyx_L1_error)
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1761, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1761, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1761, __pyx_L1_error)
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1761, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_13(__pyx_t_6);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1761, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "buelon/cython/c_hub.pyx":1762
 *         if _step.children:
 *             for child in _step.children:
 *                 if child not in __already:             # <<<<<<<<<<<<<<
 *                     __already.add(child)
 *                     self.postgres_cancel(child, __already)
 */
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_child, __pyx_v__HubClient__already, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1762, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "buelon/cython/c_hub.pyx":1763
 *             for child in _step.children:
 *                 if child not in __already:
 *                     __already.add(child)             # <<<<<<<<<<<<<<
 *                     self.postgres_cancel(child, __already)
 * 
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v__HubClient__already, __pyx_n_s_add); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1763, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_4 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_child};
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1763, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "buelon/cython/c_hub.pyx":1764
 *                 if child not in __already:
 *                     __already.add(child)
 *                     self.postgres_cancel(child, __already)             # <<<<<<<<<<<<<<
 * 
 *     def postgres_cancels(self, steps: list[buelon.core.step.Step], __already: set | None = None):
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_cancel); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1764, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_4 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_child, __pyx_v__HubClient__already};
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1764, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "buelon/cython/c_hub.pyx":1762
 *         if _step.children:
 *             for child in _step.children:
 *                 if child not in __already:             # <<<<<<<<<<<<<<
 *                     __already.add(child)
 *                     self.postgres_cancel(child, __already)
 */
      }

      /* "buelon/cython/c_hub.pyx":1761
 * 
 *         if _step.children:
 *             for child in _step.children:             # <<<<<<<<<<<<<<
 *                 if child not in __already:
 *                     __already.add(child)
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "buelon/cython/c_hub.pyx":1760
 *                     self.postgres_cancel(parent, __already)
 * 
 *         if _step.children:             # <<<<<<<<<<<<<<
 *             for child in _step.children:
 *                 if child not in __already:
 */
  }

  /* "buelon/cython/c_hub.pyx":1743
 * 
 * 
 *     def postgres_cancel(self, step_id: str, __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_first_iteration);
  __Pyx_XDECREF(__pyx_v__step);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XDECREF(__pyx_v_parent);
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v__HubClient__already);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1766
 *                     self.postgres_cancel(child, __already)
 * 
 *     def postgres_cancels(self, steps: list[buelon.core.step.Step], __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_65postgres_cancels(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubClient_65postgres_cancels = {"postgres_cancels", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubClient_65postgres_cancels, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_65postgres_cancels(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_steps = 0;
  PyObject *__pyx_v__HubClient__already = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("postgres_cancels (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_steps,&__pyx_n_s_HubClient__already,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1766, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_steps)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1766, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("postgres_cancels", 0, 2, 3, 1); __PYX_ERR(0, 1766, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_HubClient__already);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1766, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "postgres_cancels") < 0)) __PYX_ERR(0, 1766, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_steps = ((PyObject*)values[1]);
    __pyx_v__HubClient__already = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("postgres_cancels", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1766, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_cancels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_steps), (&PyList_Type), 0, "steps", 1))) __PYX_ERR(0, 1766, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_64postgres_cancels(__pyx_self, __pyx_v_self, __pyx_v_steps, __pyx_v__HubClient__already);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_16postgres_cancels_2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1773
 *         __already = set() if first_iteration else __already
 * 
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'             # <<<<<<<<<<<<<<
 *         status = buelon.core.step.StepStatus.cancel.value
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE {where}")
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_16postgres_cancels_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1773, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubClient_16postgres_cancels_2generator13, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubClient_postgres_cancels_local, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1773, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_cancels.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_6buelon_6cython_5c_hub_9HubClient_16postgres_cancels_2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1773, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1773, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1773, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1773, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__8);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_id); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__8);
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1773, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1766
 *                     self.postgres_cancel(child, __already)
 * 
 *     def postgres_cancels(self, steps: list[buelon.core.step.Step], __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_64postgres_cancels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps, PyObject *__pyx_v__HubClient__already) {
  PyObject *__pyx_v_first_iteration = NULL;
  PyObject *__pyx_v_where = NULL;
  PyObject *__pyx_v_status = NULL;
  PyObject *__pyx_v_cancels = NULL;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_16postgres_cancels_2generator13 = 0;
  PyObject *__pyx_9genexpr30__pyx_v_s = NULL;
  PyObject *__pyx_9genexpr30__pyx_v_p = NULL;
  PyObject *__pyx_9genexpr31__pyx_v_s = NULL;
  PyObject *__pyx_9genexpr31__pyx_v_c = 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;
  unsigned int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __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 *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_cancels", 0);
  __Pyx_INCREF(__pyx_v__HubClient__already);

  /* "buelon/cython/c_hub.pyx":1767
 * 
 *     def postgres_cancels(self, steps: list[buelon.core.step.Step], __already: set | None = None):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_s_db); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1767, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  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_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1767, __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, 1767, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1768
 *     def postgres_cancels(self, steps: list[buelon.core.step.Step], __already: set | None = None):
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         first_iteration = __already is None
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_postgres); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_postgres_from_env); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1768, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_db, __pyx_t_4) < 0) __PYX_ERR(0, 1768, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1767
 * 
 *     def postgres_cancels(self, steps: list[buelon.core.step.Step], __already: set | None = None):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":1770
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         first_iteration = __already is None             # <<<<<<<<<<<<<<
 *         __already = set() if first_iteration else __already
 * 
 */
  __pyx_t_1 = (__pyx_v__HubClient__already == Py_None);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_first_iteration = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1771
 * 
 *         first_iteration = __already is None
 *         __already = set() if first_iteration else __already             # <<<<<<<<<<<<<<
 * 
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_first_iteration); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1771, __pyx_L1_error)
  if (__pyx_t_1) {
    __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __pyx_t_6;
    __pyx_t_6 = 0;
  } else {
    __Pyx_INCREF(__pyx_v__HubClient__already);
    __pyx_t_4 = __pyx_v__HubClient__already;
  }
  __Pyx_DECREF_SET(__pyx_v__HubClient__already, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1773
 *         __already = set() if first_iteration else __already
 * 
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'             # <<<<<<<<<<<<<<
 *         status = buelon.core.step.StepStatus.cancel.value
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE {where}")
 */
  __pyx_t_4 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_16postgres_cancels_genexpr(NULL, __pyx_v_steps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_kp_s_id_in, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_kp_s__23); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_where = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1774
 * 
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'
 *         status = buelon.core.step.StepStatus.cancel.value             # <<<<<<<<<<<<<<
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE {where}")
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buelon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cancel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_status = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1775
 *         where = 'id in (' + ', '.join(f"'{s.id}'" for s in steps) + ')'
 *         status = buelon.core.step.StepStatus.cancel.value
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE {where}")             # <<<<<<<<<<<<<<
 * 
 *         cancels = [p for s in steps for p in s.parents if p not in __already]
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = 0;
  __pyx_t_9 = 127;
  __Pyx_INCREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_8 += 33;
  __Pyx_GIVEREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_epoch);
  __pyx_t_8 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_epoch);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_epoch);
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_12);
  __pyx_t_12 = 0;
  __Pyx_INCREF(__pyx_kp_u_state_archived_WHERE);
  __pyx_t_8 += 25;
  __Pyx_GIVEREF(__pyx_kp_u_state_archived_WHERE);
  PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u_state_archived_WHERE);
  __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_v_where, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_6, 6, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_12};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1777
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'archived\' WHERE {where}")
 * 
 *         cancels = [p for s in steps for p in s.parents if p not in __already]             # <<<<<<<<<<<<<<
 *         cancels += [c for s in steps for c in s.children if c not in __already]
 * 
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1777, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_5);
    __pyx_t_8 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1777, __pyx_L8_error)
        #endif
        if (__pyx_t_8 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_12 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1777, __pyx_L8_error)
      #else
      __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1777, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_12);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_s, __pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr30__pyx_v_s, __pyx_n_s_parents); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1777, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) {
        __pyx_t_6 = __pyx_t_12; __Pyx_INCREF(__pyx_t_6);
        __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
      } else {
        __pyx_t_13 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1777, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1777, __pyx_L8_error)
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      for (;;) {
        if (likely(!__pyx_t_14)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1777, __pyx_L8_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_12 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_12); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1777, __pyx_L8_error)
            #else
            __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1777, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_12);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1777, __pyx_L8_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_12); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1777, __pyx_L8_error)
            #else
            __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1777, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_12);
            #endif
          }
        } else {
          __pyx_t_12 = __pyx_t_14(__pyx_t_6);
          if (unlikely(!__pyx_t_12)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1777, __pyx_L8_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_12);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_p, __pyx_t_12);
        __pyx_t_12 = 0;
        __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_9genexpr30__pyx_v_p, __pyx_v__HubClient__already, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1777, __pyx_L8_error)
        if (__pyx_t_1) {
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr30__pyx_v_p))) __PYX_ERR(0, 1777, __pyx_L8_error)
        }
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_p); __pyx_9genexpr30__pyx_v_p = 0;
    __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_s); __pyx_9genexpr30__pyx_v_s = 0;
    goto __pyx_L16_exit_scope;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_p); __pyx_9genexpr30__pyx_v_p = 0;
    __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_s); __pyx_9genexpr30__pyx_v_s = 0;
    goto __pyx_L1_error;
    __pyx_L16_exit_scope:;
  } /* exit inner scope */
  __pyx_v_cancels = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1778
 * 
 *         cancels = [p for s in steps for p in s.parents if p not in __already]
 *         cancels += [c for s in steps for c in s.children if c not in __already]             # <<<<<<<<<<<<<<
 * 
 *         if cancels:
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1778, __pyx_L19_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_5);
    __pyx_t_8 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1778, __pyx_L19_error)
        #endif
        if (__pyx_t_8 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1778, __pyx_L19_error)
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1778, __pyx_L19_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr31__pyx_v_s, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr31__pyx_v_s, __pyx_n_s_children); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1778, __pyx_L19_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
        __pyx_t_12 = __pyx_t_6; __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_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1778, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1778, __pyx_L19_error)
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      for (;;) {
        if (likely(!__pyx_t_14)) {
          if (likely(PyList_CheckExact(__pyx_t_12))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1778, __pyx_L19_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1778, __pyx_L19_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1778, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1778, __pyx_L19_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1778, __pyx_L19_error)
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1778, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_14(__pyx_t_12);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1778, __pyx_L19_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr31__pyx_v_c, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_9genexpr31__pyx_v_c, __pyx_v__HubClient__already, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1778, __pyx_L19_error)
        if (__pyx_t_1) {
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr31__pyx_v_c))) __PYX_ERR(0, 1778, __pyx_L19_error)
        }
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_c); __pyx_9genexpr31__pyx_v_c = 0;
    __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_s); __pyx_9genexpr31__pyx_v_s = 0;
    goto __pyx_L27_exit_scope;
    __pyx_L19_error:;
    __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_c); __pyx_9genexpr31__pyx_v_c = 0;
    __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_s); __pyx_9genexpr31__pyx_v_s = 0;
    goto __pyx_L1_error;
    __pyx_L27_exit_scope:;
  } /* exit inner scope */
  __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_cancels, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_cancels, ((PyObject*)__pyx_t_5));
  __pyx_t_5 = 0;

  /* "buelon/cython/c_hub.pyx":1780
 *         cancels += [c for s in steps for c in s.children if c not in __already]
 * 
 *         if cancels:             # <<<<<<<<<<<<<<
 *             __already |= set(cancels)
 *             self.postgres_cancels(list(bulk_get_step(cancels).values()), __already)
 */
  __pyx_t_1 = (PyList_GET_SIZE(__pyx_v_cancels) != 0);
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1781
 * 
 *         if cancels:
 *             __already |= set(cancels)             # <<<<<<<<<<<<<<
 *             self.postgres_cancels(list(bulk_get_step(cancels).values()), __already)
 * 
 */
    __pyx_t_5 = PySet_New(__pyx_v_cancels); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyNumber_InPlaceOr(__pyx_v__HubClient__already, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v__HubClient__already, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1782
 *         if cancels:
 *             __already |= set(cancels)
 *             self.postgres_cancels(list(bulk_get_step(cancels).values()), __already)             # <<<<<<<<<<<<<<
 * 
 *     def postgres_reset(self, step_id, __already: set | None = None):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_cancels); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_bulk_get_step); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_cancels};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1782, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_values); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1782, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __pyx_t_10 = __Pyx_PySequence_ListKeepNew(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_10, __pyx_v__HubClient__already};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1782, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1780
 *         cancels += [c for s in steps for c in s.children if c not in __already]
 * 
 *         if cancels:             # <<<<<<<<<<<<<<
 *             __already |= set(cancels)
 *             self.postgres_cancels(list(bulk_get_step(cancels).values()), __already)
 */
  }

  /* "buelon/cython/c_hub.pyx":1766
 *                     self.postgres_cancel(child, __already)
 * 
 *     def postgres_cancels(self, steps: list[buelon.core.step.Step], __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_cancels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_first_iteration);
  __Pyx_XDECREF(__pyx_v_where);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XDECREF(__pyx_v_cancels);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubClient_16postgres_cancels_2generator13);
  __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_s);
  __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_p);
  __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_s);
  __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_c);
  __Pyx_XDECREF(__pyx_v__HubClient__already);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1784
 *             self.postgres_cancels(list(bulk_get_step(cancels).values()), __already)
 * 
 *     def postgres_reset(self, step_id, __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_66postgres_reset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v__HubClient__already) {
  PyObject *__pyx_v__step = NULL;
  PyObject *__pyx_v_status = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_v_parent = 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;
  unsigned int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_reset", 0);
  __Pyx_INCREF(__pyx_v__HubClient__already);

  /* "buelon/cython/c_hub.pyx":1785
 * 
 *     def postgres_reset(self, step_id, __already: set | None = None):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 *         _step = get_step(step_id)
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_s_db); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1785, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  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_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1785, __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, 1785, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1786
 *     def postgres_reset(self, step_id, __already: set | None = None):
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 *         _step = get_step(step_id)
 *         __already = set() if not __already else __already
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_postgres); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_postgres_from_env); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1786, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_db, __pyx_t_4) < 0) __PYX_ERR(0, 1786, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1785
 * 
 *     def postgres_reset(self, step_id, __already: set | None = None):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 *         _step = get_step(step_id)
 */
  }

  /* "buelon/cython/c_hub.pyx":1787
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 *         _step = get_step(step_id)             # <<<<<<<<<<<<<<
 *         __already = set() if not __already else __already
 *         status = buelon.core.step.StepStatus.queued.value if _step.parents else buelon.core.step.StepStatus.pending.value
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_get_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_step_id};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_v__step = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1788
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 *         _step = get_step(step_id)
 *         __already = set() if not __already else __already             # <<<<<<<<<<<<<<
 *         status = buelon.core.step.StepStatus.queued.value if _step.parents else buelon.core.step.StepStatus.pending.value
 *         state = 'waiting' if _step.parents else 'active'
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v__HubClient__already); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1788, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {
    __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __pyx_t_6;
    __pyx_t_6 = 0;
  } else {
    __Pyx_INCREF(__pyx_v__HubClient__already);
    __pyx_t_4 = __pyx_v__HubClient__already;
  }
  __Pyx_DECREF_SET(__pyx_v__HubClient__already, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1789
 *         _step = get_step(step_id)
 *         __already = set() if not __already else __already
 *         status = buelon.core.step.StepStatus.queued.value if _step.parents else buelon.core.step.StepStatus.pending.value             # <<<<<<<<<<<<<<
 *         state = 'waiting' if _step.parents else 'active'
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_parents); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1789, __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, 1789, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_2) {
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buelon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_core); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_queued); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pending); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __pyx_v_status = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1790
 *         __already = set() if not __already else __already
 *         status = buelon.core.step.StepStatus.queued.value if _step.parents else buelon.core.step.StepStatus.pending.value
 *         state = 'waiting' if _step.parents else 'active'             # <<<<<<<<<<<<<<
 * 
 *         # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'{state}\' WHERE id = '{_step.id}'")
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_parents); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1790, __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, 1790, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_n_s_waiting);
    __pyx_t_4 = __pyx_n_s_waiting;
  } else {
    __Pyx_INCREF(__pyx_n_s_active);
    __pyx_t_4 = __pyx_n_s_active;
  }
  __pyx_v_state = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1793
 * 
 *         # self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'{state}\' WHERE id = '{_step.id}'")
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE id = '{_step.id}'")             # <<<<<<<<<<<<<<
 * 
 *         if _step.children:
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = 0;
  __pyx_t_9 = 127;
  __Pyx_INCREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_8 += 33;
  __Pyx_GIVEREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_epoch);
  __pyx_t_8 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_epoch);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_epoch);
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_12);
  __pyx_t_12 = 0;
  __Pyx_INCREF(__pyx_kp_u_state_waiting_WHERE_id);
  __pyx_t_8 += 30;
  __Pyx_GIVEREF(__pyx_kp_u_state_waiting_WHERE_id);
  PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u_state_waiting_WHERE_id);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_id); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_12, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u__8);
  __pyx_t_8 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__8);
  PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_kp_u__8);
  __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_6, 7, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_10};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1795
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE id = '{_step.id}'")
 * 
 *         if _step.children:             # <<<<<<<<<<<<<<
 *             for child in _step.children:
 *                 if child not in __already:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1795, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1796
 * 
 *         if _step.children:
 *             for child in _step.children:             # <<<<<<<<<<<<<<
 *                 if child not in __already:
 *                     __already.add(child)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_8 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1796, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1796, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1796, __pyx_L1_error)
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1796, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1796, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1796, __pyx_L1_error)
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1796, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_13(__pyx_t_5);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1796, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "buelon/cython/c_hub.pyx":1797
 *         if _step.children:
 *             for child in _step.children:
 *                 if child not in __already:             # <<<<<<<<<<<<<<
 *                     __already.add(child)
 *                     self.postgres_reset(child, __already)
 */
      __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_child, __pyx_v__HubClient__already, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1797, __pyx_L1_error)
      if (__pyx_t_2) {

        /* "buelon/cython/c_hub.pyx":1798
 *             for child in _step.children:
 *                 if child not in __already:
 *                     __already.add(child)             # <<<<<<<<<<<<<<
 *                     self.postgres_reset(child, __already)
 * 
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v__HubClient__already, __pyx_n_s_add); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1798, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_child};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1798, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "buelon/cython/c_hub.pyx":1799
 *                 if child not in __already:
 *                     __already.add(child)
 *                     self.postgres_reset(child, __already)             # <<<<<<<<<<<<<<
 * 
 *         if _step.parents:
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_reset); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1799, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_child, __pyx_v__HubClient__already};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1799, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "buelon/cython/c_hub.pyx":1797
 *         if _step.children:
 *             for child in _step.children:
 *                 if child not in __already:             # <<<<<<<<<<<<<<
 *                     __already.add(child)
 *                     self.postgres_reset(child, __already)
 */
      }

      /* "buelon/cython/c_hub.pyx":1796
 * 
 *         if _step.children:
 *             for child in _step.children:             # <<<<<<<<<<<<<<
 *                 if child not in __already:
 *                     __already.add(child)
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1795
 *         self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE id = '{_step.id}'")
 * 
 *         if _step.children:             # <<<<<<<<<<<<<<
 *             for child in _step.children:
 *                 if child not in __already:
 */
  }

  /* "buelon/cython/c_hub.pyx":1801
 *                     self.postgres_reset(child, __already)
 * 
 *         if _step.parents:             # <<<<<<<<<<<<<<
 *             for parent in _step.parents:
 *                 if parent not in __already:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_parents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1801, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1802
 * 
 *         if _step.parents:
 *             for parent in _step.parents:             # <<<<<<<<<<<<<<
 *                 if parent not in __already:
 *                     __already.add(parent)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_parents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4);
      __pyx_t_8 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1802, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1802, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1802, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1802, __pyx_L1_error)
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1802, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1802, __pyx_L1_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1802, __pyx_L1_error)
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1802, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_13(__pyx_t_4);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1802, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_v_parent, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "buelon/cython/c_hub.pyx":1803
 *         if _step.parents:
 *             for parent in _step.parents:
 *                 if parent not in __already:             # <<<<<<<<<<<<<<
 *                     __already.add(parent)
 *                     self.postgres_reset(parent, __already)
 */
      __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_parent, __pyx_v__HubClient__already, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1803, __pyx_L1_error)
      if (__pyx_t_2) {

        /* "buelon/cython/c_hub.pyx":1804
 *             for parent in _step.parents:
 *                 if parent not in __already:
 *                     __already.add(parent)             # <<<<<<<<<<<<<<
 *                     self.postgres_reset(parent, __already)
 * 
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v__HubClient__already, __pyx_n_s_add); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1804, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_parent};
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1804, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "buelon/cython/c_hub.pyx":1805
 *                 if parent not in __already:
 *                     __already.add(parent)
 *                     self.postgres_reset(parent, __already)             # <<<<<<<<<<<<<<
 * 
 *     def postgres_resets(self, steps: list[buelon.core.step.Step], __already: set | None = None):
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_reset); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1805, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_6 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_parent, __pyx_v__HubClient__already};
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1805, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "buelon/cython/c_hub.pyx":1803
 *         if _step.parents:
 *             for parent in _step.parents:
 *                 if parent not in __already:             # <<<<<<<<<<<<<<
 *                     __already.add(parent)
 *                     self.postgres_reset(parent, __already)
 */
      }

      /* "buelon/cython/c_hub.pyx":1802
 * 
 *         if _step.parents:
 *             for parent in _step.parents:             # <<<<<<<<<<<<<<
 *                 if parent not in __already:
 *                     __already.add(parent)
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1801
 *                     self.postgres_reset(child, __already)
 * 
 *         if _step.parents:             # <<<<<<<<<<<<<<
 *             for parent in _step.parents:
 *                 if parent not in __already:
 */
  }

  /* "buelon/cython/c_hub.pyx":1784
 *             self.postgres_cancels(list(bulk_get_step(cancels).values()), __already)
 * 
 *     def postgres_reset(self, step_id, __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__step);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_parent);
  __Pyx_XDECREF(__pyx_v__HubClient__already);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1807
 *                     self.postgres_reset(parent, __already)
 * 
 *     def postgres_resets(self, steps: list[buelon.core.step.Step], __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_69postgres_resets(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubClient_69postgres_resets = {"postgres_resets", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubClient_69postgres_resets, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_69postgres_resets(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_steps = 0;
  PyObject *__pyx_v__HubClient__already = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("postgres_resets (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_steps,&__pyx_n_s_HubClient__already,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_steps)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("postgres_resets", 0, 2, 3, 1); __PYX_ERR(0, 1807, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_HubClient__already);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "postgres_resets") < 0)) __PYX_ERR(0, 1807, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_steps = ((PyObject*)values[1]);
    __pyx_v__HubClient__already = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("postgres_resets", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1807, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_resets", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_steps), (&PyList_Type), 0, "steps", 1))) __PYX_ERR(0, 1807, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_68postgres_resets(__pyx_self, __pyx_v_self, __pyx_v_steps, __pyx_v__HubClient__already);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1817
 *         queued = [s.id for s in steps if s.parents]
 *         if pendings:
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in pendings) + ')'             # <<<<<<<<<<<<<<
 *             status = buelon.core.step.StepStatus.pending.value
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1817, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_2generator14, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubClient_postgres_resets_locals, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1817, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_resets.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_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1817, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1817, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1817, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1817, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__8);
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_s, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__8);
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1817, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_5generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1821
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")
 *         if queued:
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in queued) + ')'             # <<<<<<<<<<<<<<
 *             status = buelon.core.step.StepStatus.queued.value
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1821, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_5generator15, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubClient_postgres_resets_locals, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_resets.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_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_5generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1821, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1821, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1821, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1821, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__8);
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_s, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__8);
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1821, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1807
 *                     self.postgres_reset(parent, __already)
 * 
 *     def postgres_resets(self, steps: list[buelon.core.step.Step], __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_68postgres_resets(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_steps, PyObject *__pyx_v__HubClient__already) {
  PyObject *__pyx_v_first_iteration = NULL;
  PyObject *__pyx_v_pendings = NULL;
  PyObject *__pyx_v_queued = NULL;
  PyObject *__pyx_v_where = NULL;
  PyObject *__pyx_v_status = NULL;
  PyObject *__pyx_v_resets = NULL;
  PyObject *__pyx_9genexpr32__pyx_v_s = NULL;
  PyObject *__pyx_9genexpr33__pyx_v_s = NULL;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_2generator14 = 0;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_5generator15 = 0;
  PyObject *__pyx_9genexpr36__pyx_v_s = NULL;
  PyObject *__pyx_9genexpr36__pyx_v_p = NULL;
  PyObject *__pyx_9genexpr37__pyx_v_s = NULL;
  PyObject *__pyx_9genexpr37__pyx_v_c = 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;
  unsigned int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __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 *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_resets", 0);
  __Pyx_INCREF(__pyx_v__HubClient__already);

  /* "buelon/cython/c_hub.pyx":1808
 * 
 *     def postgres_resets(self, steps: list[buelon.core.step.Step], __already: set | None = None):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_s_db); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1808, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  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_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1808, __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, 1808, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1809
 *     def postgres_resets(self, steps: list[buelon.core.step.Step], __already: set | None = None):
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         first_iteration = __already is None
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_postgres); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_postgres_from_env); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1809, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_db, __pyx_t_4) < 0) __PYX_ERR(0, 1809, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1808
 * 
 *     def postgres_resets(self, steps: list[buelon.core.step.Step], __already: set | None = None):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":1811
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         first_iteration = __already is None             # <<<<<<<<<<<<<<
 *         __already = set() if first_iteration else __already
 * 
 */
  __pyx_t_1 = (__pyx_v__HubClient__already == Py_None);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_first_iteration = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1812
 * 
 *         first_iteration = __already is None
 *         __already = set() if first_iteration else __already             # <<<<<<<<<<<<<<
 * 
 *         pendings = [s.id for s in steps if not s.parents]
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_first_iteration); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1812, __pyx_L1_error)
  if (__pyx_t_1) {
    __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __pyx_t_6;
    __pyx_t_6 = 0;
  } else {
    __Pyx_INCREF(__pyx_v__HubClient__already);
    __pyx_t_4 = __pyx_v__HubClient__already;
  }
  __Pyx_DECREF_SET(__pyx_v__HubClient__already, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1814
 *         __already = set() if first_iteration else __already
 * 
 *         pendings = [s.id for s in steps if not s.parents]             # <<<<<<<<<<<<<<
 *         queued = [s.id for s in steps if s.parents]
 *         if pendings:
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1814, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_6);
    __pyx_t_8 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1814, __pyx_L8_error)
        #endif
        if (__pyx_t_8 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1814, __pyx_L8_error)
      #else
      __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1814, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr32__pyx_v_s, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr32__pyx_v_s, __pyx_n_s_parents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1814, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1814, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = (!__pyx_t_1);
      if (__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr32__pyx_v_s, __pyx_n_s_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1814, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1814, __pyx_L8_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_s); __pyx_9genexpr32__pyx_v_s = 0;
    goto __pyx_L13_exit_scope;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_s); __pyx_9genexpr32__pyx_v_s = 0;
    goto __pyx_L1_error;
    __pyx_L13_exit_scope:;
  } /* exit inner scope */
  __pyx_v_pendings = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1815
 * 
 *         pendings = [s.id for s in steps if not s.parents]
 *         queued = [s.id for s in steps if s.parents]             # <<<<<<<<<<<<<<
 *         if pendings:
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in pendings) + ')'
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1815, __pyx_L16_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_6);
    __pyx_t_8 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1815, __pyx_L16_error)
        #endif
        if (__pyx_t_8 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1815, __pyx_L16_error)
      #else
      __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1815, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr33__pyx_v_s, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr33__pyx_v_s, __pyx_n_s_parents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1815, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1815, __pyx_L16_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr33__pyx_v_s, __pyx_n_s_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1815, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1815, __pyx_L16_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_s); __pyx_9genexpr33__pyx_v_s = 0;
    goto __pyx_L21_exit_scope;
    __pyx_L16_error:;
    __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_s); __pyx_9genexpr33__pyx_v_s = 0;
    goto __pyx_L1_error;
    __pyx_L21_exit_scope:;
  } /* exit inner scope */
  __pyx_v_queued = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1816
 *         pendings = [s.id for s in steps if not s.parents]
 *         queued = [s.id for s in steps if s.parents]
 *         if pendings:             # <<<<<<<<<<<<<<
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in pendings) + ')'
 *             status = buelon.core.step.StepStatus.pending.value
 */
  __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_pendings) != 0);
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1817
 *         queued = [s.id for s in steps if s.parents]
 *         if pendings:
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in pendings) + ')'             # <<<<<<<<<<<<<<
 *             status = buelon.core.step.StepStatus.pending.value
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")
 */
    __pyx_t_4 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_genexpr(NULL, __pyx_v_pendings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_id_in, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_kp_s__23); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_where = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "buelon/cython/c_hub.pyx":1818
 *         if pendings:
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in pendings) + ')'
 *             status = buelon.core.step.StepStatus.pending.value             # <<<<<<<<<<<<<<
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")
 *         if queued:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_buelon); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pending); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_status = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1819
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in pendings) + ')'
 *             status = buelon.core.step.StepStatus.pending.value
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")             # <<<<<<<<<<<<<<
 *         if queued:
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in queued) + ')'
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
    __pyx_t_8 += 33;
    __Pyx_GIVEREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_UPDATE_buelon_jobs_SET_status);
    __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u_epoch);
    __pyx_t_8 += 11;
    __Pyx_GIVEREF(__pyx_kp_u_epoch);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_epoch);
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
      __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1819, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_12);
    __pyx_t_12 = 0;
    __Pyx_INCREF(__pyx_kp_u_state_waiting_WHERE);
    __pyx_t_8 += 24;
    __Pyx_GIVEREF(__pyx_kp_u_state_waiting_WHERE);
    PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_u_state_waiting_WHERE);
    __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_v_where, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_6, 6, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_12};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1819, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1816
 *         pendings = [s.id for s in steps if not s.parents]
 *         queued = [s.id for s in steps if s.parents]
 *         if pendings:             # <<<<<<<<<<<<<<
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in pendings) + ')'
 *             status = buelon.core.step.StepStatus.pending.value
 */
  }

  /* "buelon/cython/c_hub.pyx":1820
 *             status = buelon.core.step.StepStatus.pending.value
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")
 *         if queued:             # <<<<<<<<<<<<<<
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in queued) + ')'
 *             status = buelon.core.step.StepStatus.queued.value
 */
  __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_queued) != 0);
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1821
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")
 *         if queued:
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in queued) + ')'             # <<<<<<<<<<<<<<
 *             status = buelon.core.step.StepStatus.queued.value
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")
 */
    __pyx_t_4 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_3genexpr(NULL, __pyx_v_queued); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_id_in, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_s__23); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_where, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1822
 *         if queued:
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in queued) + ')'
 *             status = buelon.core.step.StepStatus.queued.value             # <<<<<<<<<<<<<<
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_queued); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_status, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1823
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in queued) + ')'
 *             status = buelon.core.step.StepStatus.queued.value
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")             # <<<<<<<<<<<<<<
 * 
 *         resets = [p for s in steps for p in s.parents if p not in __already]
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_query); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
    __pyx_t_8 += 33;
    __Pyx_GIVEREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_UPDATE_buelon_jobs_SET_status);
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u_epoch);
    __pyx_t_8 += 11;
    __Pyx_GIVEREF(__pyx_kp_u_epoch);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_epoch);
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_time); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_time); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1823, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_11);
    __pyx_t_11 = 0;
    __Pyx_INCREF(__pyx_kp_u_state_waiting_WHERE);
    __pyx_t_8 += 24;
    __Pyx_GIVEREF(__pyx_kp_u_state_waiting_WHERE);
    PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u_state_waiting_WHERE);
    __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_where, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_11);
    __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_5, 6, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_11};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1823, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1820
 *             status = buelon.core.step.StepStatus.pending.value
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")
 *         if queued:             # <<<<<<<<<<<<<<
 *             where = 'id in (' + ', '.join(f"'{s}'" for s in queued) + ')'
 *             status = buelon.core.step.StepStatus.queued.value
 */
  }

  /* "buelon/cython/c_hub.pyx":1825
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {where}")
 * 
 *         resets = [p for s in steps for p in s.parents if p not in __already]             # <<<<<<<<<<<<<<
 *         resets += [c for s in steps for c in s.children if c not in __already]
 * 
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1825, __pyx_L26_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_12);
    __pyx_t_8 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1825, __pyx_L26_error)
        #endif
        if (__pyx_t_8 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_11 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1825, __pyx_L26_error)
      #else
      __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1825, __pyx_L26_error)
      __Pyx_GOTREF(__pyx_t_11);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr36__pyx_v_s, __pyx_t_11);
      __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr36__pyx_v_s, __pyx_n_s_parents); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1825, __pyx_L26_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) {
        __pyx_t_5 = __pyx_t_11; __Pyx_INCREF(__pyx_t_5);
        __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
      } else {
        __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1825, __pyx_L26_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1825, __pyx_L26_error)
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      for (;;) {
        if (likely(!__pyx_t_14)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1825, __pyx_L26_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_11); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1825, __pyx_L26_error)
            #else
            __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1825, __pyx_L26_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1825, __pyx_L26_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_11); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1825, __pyx_L26_error)
            #else
            __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1825, __pyx_L26_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          }
        } else {
          __pyx_t_11 = __pyx_t_14(__pyx_t_5);
          if (unlikely(!__pyx_t_11)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1825, __pyx_L26_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr36__pyx_v_p, __pyx_t_11);
        __pyx_t_11 = 0;
        __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_9genexpr36__pyx_v_p, __pyx_v__HubClient__already, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1825, __pyx_L26_error)
        if (__pyx_t_2) {
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr36__pyx_v_p))) __PYX_ERR(0, 1825, __pyx_L26_error)
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_p); __pyx_9genexpr36__pyx_v_p = 0;
    __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_s); __pyx_9genexpr36__pyx_v_s = 0;
    goto __pyx_L34_exit_scope;
    __pyx_L26_error:;
    __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_p); __pyx_9genexpr36__pyx_v_p = 0;
    __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_s); __pyx_9genexpr36__pyx_v_s = 0;
    goto __pyx_L1_error;
    __pyx_L34_exit_scope:;
  } /* exit inner scope */
  __pyx_v_resets = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1826
 * 
 *         resets = [p for s in steps for p in s.parents if p not in __already]
 *         resets += [c for s in steps for c in s.children if c not in __already]             # <<<<<<<<<<<<<<
 * 
 *         if resets:
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1826, __pyx_L37_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_12);
    __pyx_t_8 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1826, __pyx_L37_error)
        #endif
        if (__pyx_t_8 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1826, __pyx_L37_error)
      #else
      __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1826, __pyx_L37_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr37__pyx_v_s, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr37__pyx_v_s, __pyx_n_s_children); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1826, __pyx_L37_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_11 = __pyx_t_5; __Pyx_INCREF(__pyx_t_11);
        __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
      } else {
        __pyx_t_13 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1826, __pyx_L37_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1826, __pyx_L37_error)
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(!__pyx_t_14)) {
          if (likely(PyList_CheckExact(__pyx_t_11))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1826, __pyx_L37_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1826, __pyx_L37_error)
            #else
            __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1826, __pyx_L37_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1826, __pyx_L37_error)
              #endif
              if (__pyx_t_13 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1826, __pyx_L37_error)
            #else
            __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1826, __pyx_L37_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_14(__pyx_t_11);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1826, __pyx_L37_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr37__pyx_v_c, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_9genexpr37__pyx_v_c, __pyx_v__HubClient__already, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1826, __pyx_L37_error)
        if (__pyx_t_2) {
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr37__pyx_v_c))) __PYX_ERR(0, 1826, __pyx_L37_error)
        }
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_c); __pyx_9genexpr37__pyx_v_c = 0;
    __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_s); __pyx_9genexpr37__pyx_v_s = 0;
    goto __pyx_L45_exit_scope;
    __pyx_L37_error:;
    __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_c); __pyx_9genexpr37__pyx_v_c = 0;
    __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_s); __pyx_9genexpr37__pyx_v_s = 0;
    goto __pyx_L1_error;
    __pyx_L45_exit_scope:;
  } /* exit inner scope */
  __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_resets, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_resets, ((PyObject*)__pyx_t_12));
  __pyx_t_12 = 0;

  /* "buelon/cython/c_hub.pyx":1828
 *         resets += [c for s in steps for c in s.children if c not in __already]
 * 
 *         if resets:             # <<<<<<<<<<<<<<
 *             __already |= set(resets)
 *             self.postgres_resets(list(bulk_get_step(resets).values()), __already)
 */
  __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_resets) != 0);
  if (__pyx_t_2) {

    /* "buelon/cython/c_hub.pyx":1829
 * 
 *         if resets:
 *             __already |= set(resets)             # <<<<<<<<<<<<<<
 *             self.postgres_resets(list(bulk_get_step(resets).values()), __already)
 * 
 */
    __pyx_t_12 = PySet_New(__pyx_v_resets); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_4 = PyNumber_InPlaceOr(__pyx_v__HubClient__already, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF_SET(__pyx_v__HubClient__already, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1830
 *         if resets:
 *             __already |= set(resets)
 *             self.postgres_resets(list(bulk_get_step(resets).values()), __already)             # <<<<<<<<<<<<<<
 * 
 *     def postgres_error(self, step_id, msg, trace):
 */
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_resets); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_bulk_get_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_resets};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1830, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1830, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_6 = __Pyx_PySequence_ListKeepNew(__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_6, __pyx_v__HubClient__already};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1830, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1828
 *         resets += [c for s in steps for c in s.children if c not in __already]
 * 
 *         if resets:             # <<<<<<<<<<<<<<
 *             __already |= set(resets)
 *             self.postgres_resets(list(bulk_get_step(resets).values()), __already)
 */
  }

  /* "buelon/cython/c_hub.pyx":1807
 *                     self.postgres_reset(parent, __already)
 * 
 *     def postgres_resets(self, steps: list[buelon.core.step.Step], __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_resets", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_first_iteration);
  __Pyx_XDECREF(__pyx_v_pendings);
  __Pyx_XDECREF(__pyx_v_queued);
  __Pyx_XDECREF(__pyx_v_where);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XDECREF(__pyx_v_resets);
  __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_s);
  __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_s);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_2generator14);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubClient_15postgres_resets_5generator15);
  __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_s);
  __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_p);
  __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_s);
  __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_c);
  __Pyx_XDECREF(__pyx_v__HubClient__already);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1832
 *             self.postgres_resets(list(bulk_get_step(resets).values()), __already)
 * 
 *     def postgres_error(self, step_id, msg, trace):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_71postgres_error(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubClient_71postgres_error = {"postgres_error", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubClient_71postgres_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_71postgres_error(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_step_id = 0;
  PyObject *__pyx_v_msg = 0;
  PyObject *__pyx_v_trace = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("postgres_error (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_step_id,&__pyx_n_s_msg,&__pyx_n_s_trace,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1832, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_step_id)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1832, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("postgres_error", 1, 4, 4, 1); __PYX_ERR(0, 1832, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_msg)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1832, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("postgres_error", 1, 4, 4, 2); __PYX_ERR(0, 1832, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_trace)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1832, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("postgres_error", 1, 4, 4, 3); __PYX_ERR(0, 1832, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "postgres_error") < 0)) __PYX_ERR(0, 1832, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_step_id = values[1];
    __pyx_v_msg = values[2];
    __pyx_v_trace = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("postgres_error", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 1832, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_70postgres_error(__pyx_self, __pyx_v_self, __pyx_v_step_id, __pyx_v_msg, __pyx_v_trace);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_70postgres_error(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_step_id, PyObject *__pyx_v_msg, PyObject *__pyx_v_trace) {
  PyObject *__pyx_v_db = NULL;
  PyObject *__pyx_v_status = NULL;
  PyObject *__pyx_v_sql_update_step = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_error", 1);

  /* "buelon/cython/c_hub.pyx":1833
 * 
 *     def postgres_error(self, step_id, msg, trace):
 *         db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         status = buelon.core.step.StepStatus.error.value
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_helpers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_postgres); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1833, __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_get_postgres_from_env); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_db = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1835
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         status = buelon.core.step.StepStatus.error.value             # <<<<<<<<<<<<<<
 *         # sql_update_step = f"""UPDATE buelon_jobs_active SET status = \'{status}\', epoch = {time.time()},
 *         #      msg = $msg${msg}$msg$, trace = $trace${trace}$trace$ WHERE id = '{step_id}'"""
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_buelon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_status = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":1838
 *         # sql_update_step = f"""UPDATE buelon_jobs_active SET status = \'{status}\', epoch = {time.time()},
 *         #      msg = $msg${msg}$msg$, trace = $trace${trace}$trace$ WHERE id = '{step_id}'"""
 *         sql_update_step = f"""UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()},             # <<<<<<<<<<<<<<
 *              msg = $msg${msg}$msg$, trace = $trace${trace}$trace$, state=\'waiting\' WHERE id = '{step_id}'"""
 * 
 */
  __pyx_t_3 = PyTuple_New(11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;
  __Pyx_INCREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_5 += 33;
  __Pyx_GIVEREF(__pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_UPDATE_buelon_jobs_SET_status);
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_status, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_epoch);
  __pyx_t_5 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_epoch);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_epoch);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u_msg_msg);
  __pyx_t_5 += 27;
  __Pyx_GIVEREF(__pyx_kp_u_msg_msg);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_msg_msg);
  __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_msg, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u_msg_trace_trace);
  __pyx_t_5 += 22;
  __Pyx_GIVEREF(__pyx_kp_u_msg_trace_trace);
  PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_kp_u_msg_trace_trace);
  __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_trace, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u_trace_state_waiting_WHERE_id);
  __pyx_t_5 += 37;
  __Pyx_GIVEREF(__pyx_kp_u_trace_state_waiting_WHERE_id);
  PyTuple_SET_ITEM(__pyx_t_3, 8, __pyx_kp_u_trace_state_waiting_WHERE_id);
  __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_step_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_3, 9, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__8);
  __pyx_t_5 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__8);
  PyTuple_SET_ITEM(__pyx_t_3, 10, __pyx_kp_u__8);
  __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 11, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_sql_update_step = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1841
 *              msg = $msg${msg}$msg$, trace = $trace${trace}$trace$, state=\'waiting\' WHERE id = '{step_id}'"""
 * 
 *         db.query(sql_update_step)             # <<<<<<<<<<<<<<
 * 
 *     def postgres_upload_step(self, step_json, status_value):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_db, __pyx_n_s_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_sql_update_step};
    __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1841, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1832
 *             self.postgres_resets(list(bulk_get_step(resets).values()), __already)
 * 
 *     def postgres_error(self, step_id, msg, trace):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */

  /* 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_7);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_db);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XDECREF(__pyx_v_sql_update_step);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1843
 *         db.query(sql_update_step)
 * 
 *     def postgres_upload_step(self, step_json, status_value):             # <<<<<<<<<<<<<<
 *         return self.postgres_upload_steps([step_json], [status_value])
 * 
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_72postgres_upload_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_step_json, PyObject *__pyx_v_status_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_upload_step", 1);

  /* "buelon/cython/c_hub.pyx":1844
 * 
 *     def postgres_upload_step(self, step_json, status_value):
 *         return self.postgres_upload_steps([step_json], [status_value])             # <<<<<<<<<<<<<<
 * 
 *     def postgres_upload_steps(self, step_jsons, status_values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_postgres_upload_steps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_step_json);
  __Pyx_GIVEREF(__pyx_v_step_json);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_step_json)) __PYX_ERR(0, 1844, __pyx_L1_error);
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_status_value);
  __Pyx_GIVEREF(__pyx_v_status_value);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_status_value)) __PYX_ERR(0, 1844, __pyx_L1_error);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1844, __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;

  /* "buelon/cython/c_hub.pyx":1843
 *         db.query(sql_update_step)
 * 
 *     def postgres_upload_step(self, step_json, status_value):             # <<<<<<<<<<<<<<
 *         return self.postgres_upload_steps([step_json], [status_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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_upload_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1846
 *         return self.postgres_upload_steps([step_json], [status_value])
 * 
 *     def postgres_upload_steps(self, step_jsons, status_values):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_74postgres_upload_steps(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_step_jsons, PyObject *__pyx_v_status_values) {
  PyObject *__pyx_v_db = NULL;
  PyObject *__pyx_v_sql = NULL;
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_step_json = NULL;
  PyObject *__pyx_v_status_value = NULL;
  PyObject *__pyx_v_status = NULL;
  PyObject *__pyx_v__step = NULL;
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_v_params = NULL;
  PyObject *__pyx_v_conn = NULL;
  PyObject *__pyx_v_cur = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  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;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_t_23;
  int __pyx_t_24;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_upload_steps", 1);

  /* "buelon/cython/c_hub.pyx":1847
 * 
 *     def postgres_upload_steps(self, step_jsons, status_values):
 *         db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         sql = ('INSERT INTO buelon_jobs_waiting (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace, state) '
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_helpers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_postgres); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1847, __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_get_postgres_from_env); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1847, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_db = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1849
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         sql = ('INSERT INTO buelon_jobs_waiting (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace, state) '             # <<<<<<<<<<<<<<
 *                'VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);')
 * 
 */
  __Pyx_INCREF(__pyx_kp_s_INSERT_INTO_buelon_jobs_waiting);
  __pyx_v_sql = __pyx_kp_s_INSERT_INTO_buelon_jobs_waiting;

  /* "buelon/cython/c_hub.pyx":1852
 *                'VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);')
 * 
 *         values = []             # <<<<<<<<<<<<<<
 * 
 *         for step_json, status_value in zip(step_jsons, status_values):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_values = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1854
 *         values = []
 * 
 *         for step_json, status_value in zip(step_jsons, status_values):             # <<<<<<<<<<<<<<
 *             status = buelon.core.step.StepStatus(status_value)
 *             _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_step_jsons);
  __Pyx_GIVEREF(__pyx_v_step_jsons);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_step_jsons)) __PYX_ERR(0, 1854, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_status_values);
  __Pyx_GIVEREF(__pyx_v_status_values);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_status_values)) __PYX_ERR(0, 1854, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __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_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1854, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1854, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1854, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1854, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1854, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1854, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 1854, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1854, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1854, __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;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1854, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1854, __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_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1854, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
      index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1854, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1854, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_step_json, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_status_value, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "buelon/cython/c_hub.pyx":1855
 * 
 *         for step_json, status_value in zip(step_jsons, status_values):
 *             status = buelon.core.step.StepStatus(status_value)             # <<<<<<<<<<<<<<
 *             _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 *             state = 'waiting'  # 'active' if status == buelon.core.step.StepStatus.pending else 'waiting'
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_buelon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_core); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_step); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_status_value};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v_status, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1856
 *         for step_json, status_value in zip(step_jsons, status_values):
 *             status = buelon.core.step.StepStatus(status_value)
 *             _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)             # <<<<<<<<<<<<<<
 *             state = 'waiting'  # 'active' if status == buelon.core.step.StepStatus.pending else 'waiting'
 *             params = (_step.id, _step.priority, _step.scope, _step.timeout, _step.retries, _step.velocity, _step.tag, f'{status.value}', time.time(), '', '', state)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_buelon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_core); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_step); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Step); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1856, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_from_json); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_step_json};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1856, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_XDECREF_SET(__pyx_v__step, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1857
 *             status = buelon.core.step.StepStatus(status_value)
 *             _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 *             state = 'waiting'  # 'active' if status == buelon.core.step.StepStatus.pending else 'waiting'             # <<<<<<<<<<<<<<
 *             params = (_step.id, _step.priority, _step.scope, _step.timeout, _step.retries, _step.velocity, _step.tag, f'{status.value}', time.time(), '', '', state)
 *             values.append(params)
 */
    __Pyx_INCREF(__pyx_n_s_waiting);
    __Pyx_XDECREF_SET(__pyx_v_state, __pyx_n_s_waiting);

    /* "buelon/cython/c_hub.pyx":1858
 *             _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 *             state = 'waiting'  # 'active' if status == buelon.core.step.StepStatus.pending else 'waiting'
 *             params = (_step.id, _step.priority, _step.scope, _step.timeout, _step.retries, _step.velocity, _step.tag, f'{status.value}', time.time(), '', '', state)             # <<<<<<<<<<<<<<
 *             values.append(params)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_priority); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_scope); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_timeout); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_retries); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_velocity); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v__step, __pyx_n_s_tag); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_status, __pyx_n_s_value); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_14 = __Pyx_PyObject_FormatSimple(__pyx_t_13, __pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_time); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_time); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_15 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_16))) {
      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16);
      if (likely(__pyx_t_15)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
        __Pyx_INCREF(__pyx_t_15);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_16, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_15, NULL};
      __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    }
    __pyx_t_16 = PyTuple_New(12); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3)) __PYX_ERR(0, 1858, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_8)) __PYX_ERR(0, 1858, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_2)) __PYX_ERR(0, 1858, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_7)) __PYX_ERR(0, 1858, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_10)) __PYX_ERR(0, 1858, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_11);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11)) __PYX_ERR(0, 1858, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_12);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_12)) __PYX_ERR(0, 1858, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_14);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_14)) __PYX_ERR(0, 1858, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_13);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 8, __pyx_t_13)) __PYX_ERR(0, 1858, __pyx_L1_error);
    __Pyx_INCREF(__pyx_kp_s__3);
    __Pyx_GIVEREF(__pyx_kp_s__3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 9, __pyx_kp_s__3)) __PYX_ERR(0, 1858, __pyx_L1_error);
    __Pyx_INCREF(__pyx_kp_s__3);
    __Pyx_GIVEREF(__pyx_kp_s__3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 10, __pyx_kp_s__3)) __PYX_ERR(0, 1858, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 11, __pyx_v_state)) __PYX_ERR(0, 1858, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_8 = 0;
    __pyx_t_2 = 0;
    __pyx_t_7 = 0;
    __pyx_t_10 = 0;
    __pyx_t_11 = 0;
    __pyx_t_12 = 0;
    __pyx_t_14 = 0;
    __pyx_t_13 = 0;
    __Pyx_XDECREF_SET(__pyx_v_params, ((PyObject*)__pyx_t_16));
    __pyx_t_16 = 0;

    /* "buelon/cython/c_hub.pyx":1859
 *             state = 'waiting'  # 'active' if status == buelon.core.step.StepStatus.pending else 'waiting'
 *             params = (_step.id, _step.priority, _step.scope, _step.timeout, _step.retries, _step.velocity, _step.tag, f'{status.value}', time.time(), '', '', state)
 *             values.append(params)             # <<<<<<<<<<<<<<
 * 
 *         with db.connect() as conn:
 */
    __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_values, __pyx_v_params); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 1859, __pyx_L1_error)

    /* "buelon/cython/c_hub.pyx":1854
 *         values = []
 * 
 *         for step_json, status_value in zip(step_jsons, status_values):             # <<<<<<<<<<<<<<
 *             status = buelon.core.step.StepStatus(status_value)
 *             _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1861
 *             values.append(params)
 * 
 *         with db.connect() as conn:             # <<<<<<<<<<<<<<
 *             cur = conn.cursor()
 * 
 */
  /*with:*/ {
    __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_db, __pyx_n_s_connect); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_13 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_16))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_16);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_16, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1861, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    }
    __pyx_t_18 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit_2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_18);
    __pyx_t_13 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1861, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_14 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_13, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
      __pyx_t_16 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1861, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __pyx_t_13 = __pyx_t_16;
    __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
        __Pyx_XGOTREF(__pyx_t_19);
        __Pyx_XGOTREF(__pyx_t_20);
        __Pyx_XGOTREF(__pyx_t_21);
        /*try:*/ {
          __pyx_v_conn = __pyx_t_13;
          __pyx_t_13 = 0;

          /* "buelon/cython/c_hub.pyx":1862
 * 
 *         with db.connect() as conn:
 *             cur = conn.cursor()             # <<<<<<<<<<<<<<
 * 
 *             buelon.helpers.postgres.psycopg2.extras.execute_batch(cur, sql, tuple(values))
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_cursor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1862, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_16 = NULL;
          __pyx_t_4 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_16)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_16);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
              __pyx_t_4 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_16, NULL};
            __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1862, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __pyx_v_cur = __pyx_t_13;
          __pyx_t_13 = 0;

          /* "buelon/cython/c_hub.pyx":1864
 *             cur = conn.cursor()
 * 
 *             buelon.helpers.postgres.psycopg2.extras.execute_batch(cur, sql, tuple(values))             # <<<<<<<<<<<<<<
 * 
 *             conn.commit()
 */
          __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_buelon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1864, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_helpers); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1864, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_postgres); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1864, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_psycopg2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1864, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_extras); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1864, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_execute_batch); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1864, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyList_AsTuple(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1864, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_14 = NULL;
          __pyx_t_4 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_16))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_16);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_16, function);
              __pyx_t_4 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_14, __pyx_v_cur, __pyx_v_sql, __pyx_t_1};
            __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1864, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "buelon/cython/c_hub.pyx":1866
 *             buelon.helpers.postgres.psycopg2.extras.execute_batch(cur, sql, tuple(values))
 * 
 *             conn.commit()             # <<<<<<<<<<<<<<
 * 
 *     def postgres_get_step_count(self, types: str | None = None):
 */
          __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_commit); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1866, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_1 = NULL;
          __pyx_t_4 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_16))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_16);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_16, function);
              __pyx_t_4 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
            __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1866, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "buelon/cython/c_hub.pyx":1861
 *             values.append(params)
 * 
 *         with db.connect() as conn:             # <<<<<<<<<<<<<<
 *             cur = conn.cursor()
 * 
 */
        }
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        goto __pyx_L17_try_end;
        __pyx_L12_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_upload_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_16, &__pyx_t_1) < 0) __PYX_ERR(0, 1861, __pyx_L14_except_error)
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_1);
          __pyx_t_14 = PyTuple_Pack(3, __pyx_t_13, __pyx_t_16, __pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1861, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_14, NULL);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1861, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_22);
          __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_t_22);
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
          if (__pyx_t_23 < 0) __PYX_ERR(0, 1861, __pyx_L14_except_error)
          __pyx_t_24 = (!__pyx_t_23);
          if (unlikely(__pyx_t_24)) {
            __Pyx_GIVEREF(__pyx_t_13);
            __Pyx_GIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_13, __pyx_t_16, __pyx_t_1);
            __pyx_t_13 = 0; __pyx_t_16 = 0; __pyx_t_1 = 0; 
            __PYX_ERR(0, 1861, __pyx_L14_except_error)
          }
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L13_exception_handled;
        }
        __pyx_L14_except_error:;
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_21);
        __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
        goto __pyx_L1_error;
        __pyx_L13_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_21);
        __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
        __pyx_L17_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_18) {
          __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__5, NULL);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1861, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_21);
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
        }
        goto __pyx_L11;
      }
      __pyx_L11:;
    }
    goto __pyx_L21;
    __pyx_L8_error:;
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    goto __pyx_L1_error;
    __pyx_L21:;
  }

  /* "buelon/cython/c_hub.pyx":1846
 *         return self.postgres_upload_steps([step_json], [status_value])
 * 
 *     def postgres_upload_steps(self, step_jsons, status_values):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_upload_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_db);
  __Pyx_XDECREF(__pyx_v_sql);
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_step_json);
  __Pyx_XDECREF(__pyx_v_status_value);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XDECREF(__pyx_v__step);
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XDECREF(__pyx_v_conn);
  __Pyx_XDECREF(__pyx_v_cur);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1868
 *             conn.commit()
 * 
 *     def postgres_get_step_count(self, types: str | None = None):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_76postgres_get_step_count(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_types) {
  PyObject *__pyx_v_db = NULL;
  PyObject *__pyx_v_where = NULL;
  PyObject *__pyx_v_query = NULL;
  PyObject *__pyx_v_table = 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;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_get_step_count", 1);

  /* "buelon/cython/c_hub.pyx":1869
 * 
 *     def postgres_get_step_count(self, types: str | None = None):
 *         db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         if types == '*':
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_helpers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_postgres); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1869, __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_get_postgres_from_env); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_db = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1871
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         if types == '*':             # <<<<<<<<<<<<<<
 *             where = ''
 *         else:
 */
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_types, __pyx_kp_s__11, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1871, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "buelon/cython/c_hub.pyx":1872
 * 
 *         if types == '*':
 *             where = ''             # <<<<<<<<<<<<<<
 *         else:
 *             where = f'''
 */
    __Pyx_INCREF(__pyx_kp_s__3);
    __pyx_v_where = __pyx_kp_s__3;

    /* "buelon/cython/c_hub.pyx":1871
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         if types == '*':             # <<<<<<<<<<<<<<
 *             where = ''
 *         else:
 */
    goto __pyx_L3;
  }

  /* "buelon/cython/c_hub.pyx":1874
 *             where = ''
 *         else:
 *             where = f'''             # <<<<<<<<<<<<<<
 *             where
 *                 status not in (
 */
  /*else*/ {
    __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u_where_status_not_in_2);
    __pyx_t_6 += 73;
    __Pyx_GIVEREF(__pyx_kp_u_where_status_not_in_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_where_status_not_in_2);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_core); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1874, __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_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1874, __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_success); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__48);
    __pyx_t_6 += 25;
    __Pyx_GIVEREF(__pyx_kp_u__48);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__48);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_core); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1874, __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_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1874, __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_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__49);
    __pyx_t_6 += 32;
    __Pyx_GIVEREF(__pyx_kp_u__49);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__49);
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_where = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "buelon/cython/c_hub.pyx":1882
 *             '''
 * 
 *         query = f'''             # <<<<<<<<<<<<<<
 *         select
 *             status,
 */
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = 0;
  __pyx_t_7 = 127;
  __Pyx_INCREF(__pyx_kp_u_select_status_count_as_amount_f_2);
  __pyx_t_6 += 114;
  __Pyx_GIVEREF(__pyx_kp_u_select_status_count_as_amount_f_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_select_status_count_as_amount_f_2);
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_where, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_group_by_status_2);
  __pyx_t_6 += 47;
  __Pyx_GIVEREF(__pyx_kp_u_group_by_status_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_group_by_status_2);
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_query = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1892
 *             status;
 *         '''
 *         table = db.download_table(sql=query)             # <<<<<<<<<<<<<<
 *         for row in table:
 *             row['status'] = buelon.core.step.StepStatus(int(row['status'])).name
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_db, __pyx_n_s_download_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_sql, __pyx_v_query) < 0) __PYX_ERR(0, 1892, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1892, __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_v_table = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1893
 *         '''
 *         table = db.download_table(sql=query)
 *         for row in table:             # <<<<<<<<<<<<<<
 *             row['status'] = buelon.core.step.StepStatus(int(row['status'])).name
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_table)) || PyTuple_CheckExact(__pyx_v_table)) {
    __pyx_t_2 = __pyx_v_table; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1893, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1893, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1893, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1893, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1893, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1893, __pyx_L1_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1893, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_8(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1893, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":1894
 *         table = db.download_table(sql=query)
 *         for row in table:
 *             row['status'] = buelon.core.step.StepStatus(int(row['status'])).name             # <<<<<<<<<<<<<<
 * 
 *         return table
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_buelon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_core); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_10};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1894, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely((PyObject_SetItem(__pyx_v_row, __pyx_n_s_status, __pyx_t_9) < 0))) __PYX_ERR(0, 1894, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "buelon/cython/c_hub.pyx":1893
 *         '''
 *         table = db.download_table(sql=query)
 *         for row in table:             # <<<<<<<<<<<<<<
 *             row['status'] = buelon.core.step.StepStatus(int(row['status'])).name
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1896
 *             row['status'] = buelon.core.step.StepStatus(int(row['status'])).name
 * 
 *         return table             # <<<<<<<<<<<<<<
 * 
 *     def postgres_reset_errors(self, include_workers: bool=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_table);
  __pyx_r = __pyx_v_table;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1868
 *             conn.commit()
 * 
 *     def postgres_get_step_count(self, types: str | None = None):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_get_step_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_db);
  __Pyx_XDECREF(__pyx_v_where);
  __Pyx_XDECREF(__pyx_v_query);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1898
 *         return table
 * 
 *     def postgres_reset_errors(self, include_workers: bool=False):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 *         suffix = '' if not include_workers else f' or status = \'{buelon.core.step.StepStatus.working.value}\''
 */

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

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_78postgres_reset_errors(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_include_workers) {
  PyObject *__pyx_v_db = NULL;
  PyObject *__pyx_v_suffix = NULL;
  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;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_UCS4 __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_reset_errors", 1);

  /* "buelon/cython/c_hub.pyx":1899
 * 
 *     def postgres_reset_errors(self, include_workers: bool=False):
 *         db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 *         suffix = '' if not include_workers else f' or status = \'{buelon.core.step.StepStatus.working.value}\''
 *         query = f'''
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_helpers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_postgres); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1899, __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_get_postgres_from_env); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_db = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1900
 *     def postgres_reset_errors(self, include_workers: bool=False):
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 *         suffix = '' if not include_workers else f' or status = \'{buelon.core.step.StepStatus.working.value}\''             # <<<<<<<<<<<<<<
 *         query = f'''
 *             update buelon_jobs
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_include_workers); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1900, __pyx_L1_error)
  __pyx_t_6 = (!__pyx_t_5);
  if (__pyx_t_6) {
    __Pyx_INCREF(__pyx_kp_s__3);
    __pyx_t_1 = __pyx_kp_s__3;
  } else {
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = 0;
    __pyx_t_8 = 127;
    __Pyx_INCREF(__pyx_kp_u_or_status);
    __pyx_t_7 += 14;
    __Pyx_GIVEREF(__pyx_kp_u_or_status);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_or_status);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_working); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_8;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u__8);
    __pyx_t_7 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__8);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__8);
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_v_suffix = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1901
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 *         suffix = '' if not include_workers else f' or status = \'{buelon.core.step.StepStatus.working.value}\''
 *         query = f'''             # <<<<<<<<<<<<<<
 *             update buelon_jobs
 *             set status = \'{buelon.core.step.StepStatus.pending.value}\'
 */
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = 0;
  __pyx_t_8 = 127;
  __Pyx_INCREF(__pyx_kp_u_update_buelon_jobs_set_status);
  __pyx_t_7 += 58;
  __Pyx_GIVEREF(__pyx_kp_u_update_buelon_jobs_set_status);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_update_buelon_jobs_set_status);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1901, __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_StepStatus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pending); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1901, __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_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_8;
  __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u_where_status_2);
  __pyx_t_7 += 30;
  __Pyx_GIVEREF(__pyx_kp_u_where_status_2);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_where_status_2);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1901, __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_StepStatus); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1901, __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_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_8;
  __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__50);
  __pyx_t_7 += 14;
  __Pyx_GIVEREF(__pyx_kp_u__50);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__50);
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_suffix, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_8;
  __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__10);
  __pyx_t_7 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__10);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__10);
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_query = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1906
 *             where status = \'{buelon.core.step.StepStatus.error.value}\'
 *             {suffix};'''
 *         db.query(query)             # <<<<<<<<<<<<<<
 * 
 *     def postgres_delete_steps(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_db, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_query};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1906, __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;

  /* "buelon/cython/c_hub.pyx":1898
 *         return table
 * 
 *     def postgres_reset_errors(self, include_workers: bool=False):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 *         suffix = '' if not include_workers else f' or status = \'{buelon.core.step.StepStatus.working.value}\''
 */

  /* 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_9);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_reset_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_db);
  __Pyx_XDECREF(__pyx_v_suffix);
  __Pyx_XDECREF(__pyx_v_query);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1908
 *         db.query(query)
 * 
 *     def postgres_delete_steps(self):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 *         db.query('delete from buelon_jobs;')
 */

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

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

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

  /* "buelon/cython/c_hub.pyx":1909
 * 
 *     def postgres_delete_steps(self):
 *         db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 *         db.query('delete from buelon_jobs;')
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_buelon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_helpers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_postgres); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1909, __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_get_postgres_from_env); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v_db = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":1910
 *     def postgres_delete_steps(self):
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 *         db.query('delete from buelon_jobs;')             # <<<<<<<<<<<<<<
 * 
 *     def postgres_fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_db, __pyx_n_s_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_s_delete_from_buelon_jobs};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1910, __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;

  /* "buelon/cython/c_hub.pyx":1908
 *         db.query(query)
 * 
 *     def postgres_delete_steps(self):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 *         db.query('delete from buelon_jobs;')
 */

  /* 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("buelon.cython.c_hub.HubClient.postgres_delete_steps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_db);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1912
 *         db.query('delete from buelon_jobs;')
 * 
 *     def postgres_fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *         try:
 *             count = int(count)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_83postgres_fetch_errors(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubClient_83postgres_fetch_errors = {"postgres_fetch_errors", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubClient_83postgres_fetch_errors, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_83postgres_fetch_errors(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_count = 0;
  PyObject *__pyx_v_exclude = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("postgres_fetch_errors (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_count,&__pyx_n_s_exclude,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1912, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_count)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1912, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("postgres_fetch_errors", 0, 2, 3, 1); __PYX_ERR(0, 1912, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exclude);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1912, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "postgres_fetch_errors") < 0)) __PYX_ERR(0, 1912, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_count = ((PyObject*)values[1]);
    __pyx_v_exclude = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("postgres_fetch_errors", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1912, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_fetch_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_count), (&PyInt_Type), 0, "count", 1))) __PYX_ERR(0, 1912, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_82postgres_fetch_errors(__pyx_self, __pyx_v_self, __pyx_v_count, __pyx_v_exclude);

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

/* "buelon/cython/c_hub.pyx":1927
 *         allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 * 
 *         def clean_query_string(query_string: str) -> str:             # <<<<<<<<<<<<<<
 *             return ''.join(c for c in query_string if c in allow_chars)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_1clean_query_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_1clean_query_string = {"clean_query_string", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_1clean_query_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_1clean_query_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_query_string = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clean_query_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query_string,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query_string)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1927, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "clean_query_string") < 0)) __PYX_ERR(0, 1927, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_query_string = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("clean_query_string", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1927, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_fetch_errors.clean_query_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query_string), (&PyString_Type), 0, "query_string", 1))) __PYX_ERR(0, 1927, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_clean_query_string(__pyx_self, __pyx_v_query_string);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_18clean_query_string_2generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1928
 * 
 *         def clean_query_string(query_string: str) -> str:
 *             return ''.join(c for c in query_string if c in allow_chars)             # <<<<<<<<<<<<<<
 * 
 *         exclude_query = ''
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_18clean_query_string_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1928, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_18clean_query_string_2generator17, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubClient_postgres_fetch_errors, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1928, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_fetch_errors.clean_query_string.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_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_18clean_query_string_2generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *(*__pyx_t_2)(PyObject *);
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_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, 1928, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1928, __pyx_L1_error) }
  __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1928, __pyx_L1_error)
  for (;;) {
    {
      __pyx_t_3 = __pyx_t_2(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1928, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_allow_chars)) { __Pyx_RaiseClosureNameError("allow_chars"); __PYX_ERR(0, 1928, __pyx_L1_error) }
    __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_c, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_allow_chars, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1928, __pyx_L1_error)
    if (__pyx_t_4) {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_c);
      __pyx_r = __pyx_cur_scope->__pyx_v_c;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1928, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1927
 *         allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 * 
 *         def clean_query_string(query_string: str) -> str:             # <<<<<<<<<<<<<<
 *             return ''.join(c for c in query_string if c in allow_chars)
 * 
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_clean_query_string(PyObject *__pyx_self, PyObject *__pyx_v_query_string) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *__pyx_cur_scope;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *__pyx_outer_scope;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_18clean_query_string_2generator17 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clean_query_string", 1);
  __pyx_outer_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "buelon/cython/c_hub.pyx":1928
 * 
 *         def clean_query_string(query_string: str) -> str:
 *             return ''.join(c for c in query_string if c in allow_chars)             # <<<<<<<<<<<<<<
 * 
 *         exclude_query = ''
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_18clean_query_string_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_query_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 1928, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1927
 *         allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 * 
 *         def clean_query_string(query_string: str) -> str:             # <<<<<<<<<<<<<<
 *             return ''.join(c for c in query_string if c in allow_chars)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_fetch_errors.clean_query_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_18clean_query_string_2generator17);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_4generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1920
 *                 raise ValueError('exclude must be a string or a list')
 * 
 *             if isinstance(exclude, list) and not all(isinstance(x, str) for x in exclude):             # <<<<<<<<<<<<<<
 *                 raise ValueError('exclude must be a list of strings')
 *         except ValueError:
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_2genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1920, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_4generator16, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubClient_postgres_fetch_errors_2, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1920, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_fetch_errors.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_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_4generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1920, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1920, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1920, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1920, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1920, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1920, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1920, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1920, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1920, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1920, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_5 = PyString_Check(__pyx_cur_scope->__pyx_v_x); 
    __pyx_t_6 = (!__pyx_t_5);
    if (__pyx_t_6) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_7generator18(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1936
 *             exclude_query = (' AND not ('
 *                              + ' OR '.join(
 *                         f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''             # <<<<<<<<<<<<<<
 *                         for ex in exclude)
 *                              + ')')
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_5genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1936, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_7generator18, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubClient_postgres_fetch_errors_2, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1936, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_fetch_errors.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_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_7generator18(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1936, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1937
 *                              + ' OR '.join(
 *                         f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''
 *                         for ex in exclude)             # <<<<<<<<<<<<<<
 *                              + ')')
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1937, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1937, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1937, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1937, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1937, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1937, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1937, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1937, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1937, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_ex);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_ex, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1936
 *             exclude_query = (' AND not ('
 *                              + ' OR '.join(
 *                         f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''             # <<<<<<<<<<<<<<
 *                         for ex in exclude)
 *                              + ')')
 */
    __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_lower_msg_like);
    __pyx_t_5 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_lower_msg_like);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_lower_msg_like);
    if (!(likely(PyString_CheckExact(__pyx_cur_scope->__pyx_v_ex))||((__pyx_cur_scope->__pyx_v_ex) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_cur_scope->__pyx_v_ex))) __PYX_ERR(0, 1936, __pyx_L1_error)
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_clean_query_string)) { __Pyx_RaiseClosureNameError("clean_query_string"); __PYX_ERR(0, 1936, __pyx_L1_error) }
    __pyx_t_7 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_clean_query_string(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_clean_query_string, ((PyObject*)__pyx_cur_scope->__pyx_v_ex)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_kp_u_OR_lower_trace_like);
    __pyx_t_5 += 26;
    __Pyx_GIVEREF(__pyx_kp_u_OR_lower_trace_like);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_OR_lower_trace_like);
    if (!(likely(PyString_CheckExact(__pyx_cur_scope->__pyx_v_ex))||((__pyx_cur_scope->__pyx_v_ex) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_cur_scope->__pyx_v_ex))) __PYX_ERR(0, 1936, __pyx_L1_error)
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_clean_query_string)) { __Pyx_RaiseClosureNameError("clean_query_string"); __PYX_ERR(0, 1936, __pyx_L1_error) }
    __pyx_t_8 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_clean_query_string(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_clean_query_string, ((PyObject*)__pyx_cur_scope->__pyx_v_ex)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__24);
    __pyx_t_5 += 2;
    __Pyx_GIVEREF(__pyx_kp_u__24);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u__24);
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1936, __pyx_L1_error)

    /* "buelon/cython/c_hub.pyx":1937
 *                              + ' OR '.join(
 *                         f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''
 *                         for ex in exclude)             # <<<<<<<<<<<<<<
 *                              + ')')
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "buelon/cython/c_hub.pyx":1936
 *             exclude_query = (' AND not ('
 *                              + ' OR '.join(
 *                         f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''             # <<<<<<<<<<<<<<
 *                         for ex in exclude)
 *                              + ')')
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1912
 *         db.query('delete from buelon_jobs;')
 * 
 *     def postgres_fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *         try:
 *             count = int(count)
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_82postgres_fetch_errors(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_count, PyObject *__pyx_v_exclude) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *__pyx_cur_scope;
  PyObject *__pyx_v_exclude_query = NULL;
  PyObject *__pyx_v_sql = NULL;
  PyObject *__pyx_v_error_size_query = NULL;
  PyObject *__pyx_v_db = NULL;
  PyObject *__pyx_v_table = NULL;
  PyObject *__pyx_v_error_size = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_4generator16 = 0;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_7generator18 = 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;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_UCS4 __pyx_t_13;
  unsigned int __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_fetch_errors", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1912, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __Pyx_INCREF(__pyx_v_count);
  __Pyx_INCREF(__pyx_v_exclude);

  /* "buelon/cython/c_hub.pyx":1913
 * 
 *     def postgres_fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:
 *         try:             # <<<<<<<<<<<<<<
 *             count = int(count)
 *             exclude = exclude
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "buelon/cython/c_hub.pyx":1914
 *     def postgres_fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:
 *         try:
 *             count = int(count)             # <<<<<<<<<<<<<<
 *             exclude = exclude
 * 
 */
      __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1914, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_4)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_4))) __PYX_ERR(0, 1914, __pyx_L3_error)
      __Pyx_DECREF_SET(__pyx_v_count, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "buelon/cython/c_hub.pyx":1915
 *         try:
 *             count = int(count)
 *             exclude = exclude             # <<<<<<<<<<<<<<
 * 
 *             if not isinstance(exclude, (type(None), str, list)):
 */
      __Pyx_INCREF(__pyx_v_exclude);
      __Pyx_DECREF_SET(__pyx_v_exclude, __pyx_v_exclude);

      /* "buelon/cython/c_hub.pyx":1917
 *             exclude = exclude
 * 
 *             if not isinstance(exclude, (type(None), str, list)):             # <<<<<<<<<<<<<<
 *                 raise ValueError('exclude must be a string or a list')
 * 
 */
      __Pyx_INCREF(((PyObject *)Py_TYPE(Py_None)));
      __pyx_t_4 = ((PyObject *)Py_TYPE(Py_None));
      __pyx_t_6 = PyObject_IsInstance(__pyx_v_exclude, __pyx_t_4); 
      if (!__pyx_t_6) {
      } else {
        __pyx_t_5 = __pyx_t_6;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_6 = PyString_Check(__pyx_v_exclude); 
      if (!__pyx_t_6) {
      } else {
        __pyx_t_5 = __pyx_t_6;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_6 = PyList_Check(__pyx_v_exclude); 
      __pyx_t_5 = __pyx_t_6;
      __pyx_L10_bool_binop_done:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = (!__pyx_t_5);
      if (unlikely(__pyx_t_6)) {

        /* "buelon/cython/c_hub.pyx":1918
 * 
 *             if not isinstance(exclude, (type(None), str, list)):
 *                 raise ValueError('exclude must be a string or a list')             # <<<<<<<<<<<<<<
 * 
 *             if isinstance(exclude, list) and not all(isinstance(x, str) for x in exclude):
 */
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1918, __pyx_L3_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, 1918, __pyx_L3_error)

        /* "buelon/cython/c_hub.pyx":1917
 *             exclude = exclude
 * 
 *             if not isinstance(exclude, (type(None), str, list)):             # <<<<<<<<<<<<<<
 *                 raise ValueError('exclude must be a string or a list')
 * 
 */
      }

      /* "buelon/cython/c_hub.pyx":1920
 *                 raise ValueError('exclude must be a string or a list')
 * 
 *             if isinstance(exclude, list) and not all(isinstance(x, str) for x in exclude):             # <<<<<<<<<<<<<<
 *                 raise ValueError('exclude must be a list of strings')
 *         except ValueError:
 */
      __pyx_t_5 = PyList_Check(__pyx_v_exclude); 
      if (__pyx_t_5) {
      } else {
        __pyx_t_6 = __pyx_t_5;
        goto __pyx_L14_bool_binop_done;
      }
      __pyx_t_4 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_2genexpr(NULL, __pyx_v_exclude); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1920, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_Generator_Next(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1920, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1920, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = (!__pyx_t_5);
      __pyx_t_6 = __pyx_t_8;
      __pyx_L14_bool_binop_done:;
      if (unlikely(__pyx_t_6)) {

        /* "buelon/cython/c_hub.pyx":1921
 * 
 *             if isinstance(exclude, list) and not all(isinstance(x, str) for x in exclude):
 *                 raise ValueError('exclude must be a list of strings')             # <<<<<<<<<<<<<<
 *         except ValueError:
 *             count = 5
 */
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1921, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(0, 1921, __pyx_L3_error)

        /* "buelon/cython/c_hub.pyx":1920
 *                 raise ValueError('exclude must be a string or a list')
 * 
 *             if isinstance(exclude, list) and not all(isinstance(x, str) for x in exclude):             # <<<<<<<<<<<<<<
 *                 raise ValueError('exclude must be a list of strings')
 *         except ValueError:
 */
      }

      /* "buelon/cython/c_hub.pyx":1913
 * 
 *     def postgres_fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:
 *         try:             # <<<<<<<<<<<<<<
 *             count = int(count)
 *             exclude = exclude
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "buelon/cython/c_hub.pyx":1922
 *             if isinstance(exclude, list) and not all(isinstance(x, str) for x in exclude):
 *                 raise ValueError('exclude must be a list of strings')
 *         except ValueError:             # <<<<<<<<<<<<<<
 *             count = 5
 *             exclude = None
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_fetch_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_10) < 0) __PYX_ERR(0, 1922, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_10);

      /* "buelon/cython/c_hub.pyx":1923
 *                 raise ValueError('exclude must be a list of strings')
 *         except ValueError:
 *             count = 5             # <<<<<<<<<<<<<<
 *             exclude = None
 *         allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 */
      if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_5))) __PYX_ERR(0, 1923, __pyx_L5_except_error)
      __pyx_t_11 = __pyx_int_5;
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_DECREF_SET(__pyx_v_count, ((PyObject*)__pyx_t_11));
      __pyx_t_11 = 0;

      /* "buelon/cython/c_hub.pyx":1924
 *         except ValueError:
 *             count = 5
 *             exclude = None             # <<<<<<<<<<<<<<
 *         allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 * 
 */
      __Pyx_INCREF(Py_None);
      __Pyx_DECREF_SET(__pyx_v_exclude, Py_None);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "buelon/cython/c_hub.pyx":1913
 * 
 *     def postgres_fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:
 *         try:             # <<<<<<<<<<<<<<
 *             count = int(count)
 *             exclude = exclude
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "buelon/cython/c_hub.pyx":1925
 *             count = 5
 *             exclude = None
 *         allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'             # <<<<<<<<<<<<<<
 * 
 *         def clean_query_string(query_string: str) -> str:
 */
  __Pyx_INCREF(__pyx_kp_s_abcdefghijklmnopqrstuvwxyzABCDE);
  __Pyx_GIVEREF(__pyx_kp_s_abcdefghijklmnopqrstuvwxyzABCDE);
  __pyx_cur_scope->__pyx_v_allow_chars = __pyx_kp_s_abcdefghijklmnopqrstuvwxyzABCDE;

  /* "buelon/cython/c_hub.pyx":1927
 *         allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 * 
 *         def clean_query_string(query_string: str) -> str:             # <<<<<<<<<<<<<<
 *             return ''.join(c for c in query_string if c in allow_chars)
 * 
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_query_string, __pyx_n_s_str) < 0) __PYX_ERR(0, 1927, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_str) < 0) __PYX_ERR(0, 1927, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_1clean_query_string, 0, __pyx_n_s_HubClient_postgres_fetch_errors_3, ((PyObject*)__pyx_cur_scope), __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_clean_query_string = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1930
 *             return ''.join(c for c in query_string if c in allow_chars)
 * 
 *         exclude_query = ''             # <<<<<<<<<<<<<<
 *         if isinstance(exclude, str):
 *             exclude_query = f' AND not (lower(msg) like \'%{clean_query_string(exclude)}%\' OR lower(trace) like \'%{clean_query_string(exclude)}%\')'
 */
  __Pyx_INCREF(__pyx_kp_s__3);
  __pyx_v_exclude_query = __pyx_kp_s__3;

  /* "buelon/cython/c_hub.pyx":1931
 * 
 *         exclude_query = ''
 *         if isinstance(exclude, str):             # <<<<<<<<<<<<<<
 *             exclude_query = f' AND not (lower(msg) like \'%{clean_query_string(exclude)}%\' OR lower(trace) like \'%{clean_query_string(exclude)}%\')'
 *         elif isinstance(exclude, list):
 */
  __pyx_t_6 = PyString_Check(__pyx_v_exclude); 
  if (__pyx_t_6) {

    /* "buelon/cython/c_hub.pyx":1932
 *         exclude_query = ''
 *         if isinstance(exclude, str):
 *             exclude_query = f' AND not (lower(msg) like \'%{clean_query_string(exclude)}%\' OR lower(trace) like \'%{clean_query_string(exclude)}%\')'             # <<<<<<<<<<<<<<
 *         elif isinstance(exclude, list):
 *             exclude_query = (' AND not ('
 */
    __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = 0;
    __pyx_t_13 = 127;
    __Pyx_INCREF(__pyx_kp_u_AND_not_lower_msg_like);
    __pyx_t_12 += 28;
    __Pyx_GIVEREF(__pyx_kp_u_AND_not_lower_msg_like);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_AND_not_lower_msg_like);
    if (!(likely(PyString_CheckExact(__pyx_v_exclude))||((__pyx_v_exclude) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_exclude))) __PYX_ERR(0, 1932, __pyx_L1_error)
    __pyx_t_10 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_clean_query_string(__pyx_cur_scope->__pyx_v_clean_query_string, ((PyObject*)__pyx_v_exclude)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_13;
    __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_OR_lower_trace_like);
    __pyx_t_12 += 26;
    __Pyx_GIVEREF(__pyx_kp_u_OR_lower_trace_like);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_OR_lower_trace_like);
    if (!(likely(PyString_CheckExact(__pyx_v_exclude))||((__pyx_v_exclude) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_exclude))) __PYX_ERR(0, 1932, __pyx_L1_error)
    __pyx_t_7 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_clean_query_string(__pyx_cur_scope->__pyx_v_clean_query_string, ((PyObject*)__pyx_v_exclude)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_13;
    __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u__30);
    __pyx_t_12 += 3;
    __Pyx_GIVEREF(__pyx_kp_u__30);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u__30);
    __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_exclude_query, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "buelon/cython/c_hub.pyx":1931
 * 
 *         exclude_query = ''
 *         if isinstance(exclude, str):             # <<<<<<<<<<<<<<
 *             exclude_query = f' AND not (lower(msg) like \'%{clean_query_string(exclude)}%\' OR lower(trace) like \'%{clean_query_string(exclude)}%\')'
 *         elif isinstance(exclude, list):
 */
    goto __pyx_L18;
  }

  /* "buelon/cython/c_hub.pyx":1933
 *         if isinstance(exclude, str):
 *             exclude_query = f' AND not (lower(msg) like \'%{clean_query_string(exclude)}%\' OR lower(trace) like \'%{clean_query_string(exclude)}%\')'
 *         elif isinstance(exclude, list):             # <<<<<<<<<<<<<<
 *             exclude_query = (' AND not ('
 *                              + ' OR '.join(
 */
  __pyx_t_6 = PyList_Check(__pyx_v_exclude); 
  if (__pyx_t_6) {

    /* "buelon/cython/c_hub.pyx":1936
 *             exclude_query = (' AND not ('
 *                              + ' OR '.join(
 *                         f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''             # <<<<<<<<<<<<<<
 *                         for ex in exclude)
 *                              + ')')
 */
    __pyx_t_10 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_5genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_exclude); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);

    /* "buelon/cython/c_hub.pyx":1935
 *         elif isinstance(exclude, list):
 *             exclude_query = (' AND not ('
 *                              + ' OR '.join(             # <<<<<<<<<<<<<<
 *                         f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''
 *                         for ex in exclude)
 */
    __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s_OR, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Add(__pyx_kp_s_AND_not, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1938
 *                         f'lower(msg) like \'%{clean_query_string(ex)}%\' OR lower(trace) like \'%{clean_query_string(ex)}%\''
 *                         for ex in exclude)
 *                              + ')')             # <<<<<<<<<<<<<<
 * 
 *         sql = f'SELECT id, msg, trace FROM buelon_jobs WHERE status = \'{buelon.core.step.StepStatus.error.value}\' {exclude_query}  LIMIT {count}'
 */
    __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_kp_s__23); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1938, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF_SET(__pyx_v_exclude_query, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "buelon/cython/c_hub.pyx":1933
 *         if isinstance(exclude, str):
 *             exclude_query = f' AND not (lower(msg) like \'%{clean_query_string(exclude)}%\' OR lower(trace) like \'%{clean_query_string(exclude)}%\')'
 *         elif isinstance(exclude, list):             # <<<<<<<<<<<<<<
 *             exclude_query = (' AND not ('
 *                              + ' OR '.join(
 */
  }
  __pyx_L18:;

  /* "buelon/cython/c_hub.pyx":1940
 *                              + ')')
 * 
 *         sql = f'SELECT id, msg, trace FROM buelon_jobs WHERE status = \'{buelon.core.step.StepStatus.error.value}\' {exclude_query}  LIMIT {count}'             # <<<<<<<<<<<<<<
 *         error_size_query = f'SELECT COUNT(*)  FROM buelon_jobs WHERE status = \'{buelon.core.step.StepStatus.error.value}\' {exclude_query}'
 * 
 */
  __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = 0;
  __pyx_t_13 = 127;
  __Pyx_INCREF(__pyx_kp_u_SELECT_id_msg_trace_FROM_buelon);
  __pyx_t_12 += 55;
  __Pyx_GIVEREF(__pyx_kp_u_SELECT_id_msg_trace_FROM_buelon);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_SELECT_id_msg_trace_FROM_buelon);
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_buelon); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_core); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_step); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_12 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__31);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_exclude_query, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_INCREF(__pyx_kp_u_LIMIT_5);
  __pyx_t_12 += 8;
  __Pyx_GIVEREF(__pyx_kp_u_LIMIT_5);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_LIMIT_5);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_count, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_4, 6, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_sql = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "buelon/cython/c_hub.pyx":1941
 * 
 *         sql = f'SELECT id, msg, trace FROM buelon_jobs WHERE status = \'{buelon.core.step.StepStatus.error.value}\' {exclude_query}  LIMIT {count}'
 *         error_size_query = f'SELECT COUNT(*)  FROM buelon_jobs WHERE status = \'{buelon.core.step.StepStatus.error.value}\' {exclude_query}'             # <<<<<<<<<<<<<<
 * 
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = 0;
  __pyx_t_13 = 127;
  __Pyx_INCREF(__pyx_kp_u_SELECT_COUNT_FROM_buelon_jobs_WH);
  __pyx_t_12 += 50;
  __Pyx_GIVEREF(__pyx_kp_u_SELECT_COUNT_FROM_buelon_jobs_WH);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_u_SELECT_COUNT_FROM_buelon_jobs_WH);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_buelon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_core); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_t_12 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_kp_u__31);
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_exclude_query, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_13;
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_error_size_query = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1943
 *         error_size_query = f'SELECT COUNT(*)  FROM buelon_jobs WHERE status = \'{buelon.core.step.StepStatus.error.value}\' {exclude_query}'
 * 
 *         db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         table = db.download_table(sql=sql)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_buelon); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_helpers); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_postgres); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_get_postgres_from_env); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = NULL;
  __pyx_t_14 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_14 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_14, 0+__pyx_t_14);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_v_db = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "buelon/cython/c_hub.pyx":1945
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         table = db.download_table(sql=sql)             # <<<<<<<<<<<<<<
 *         error_size = db.query(error_size_query)[0][0]
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_db, __pyx_n_s_download_table); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_sql, __pyx_v_sql) < 0) __PYX_ERR(0, 1945, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_table = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "buelon/cython/c_hub.pyx":1946
 * 
 *         table = db.download_table(sql=sql)
 *         error_size = db.query(error_size_query)[0][0]             # <<<<<<<<<<<<<<
 * 
 *         for row in table:
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_db, __pyx_n_s_query); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = NULL;
  __pyx_t_14 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_14 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_error_size_query};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_error_size = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "buelon/cython/c_hub.pyx":1948
 *         error_size = db.query(error_size_query)[0][0]
 * 
 *         for row in table:             # <<<<<<<<<<<<<<
 *             row['step'] = get_step(row['id']).to_json()
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_table)) || PyTuple_CheckExact(__pyx_v_table)) {
    __pyx_t_10 = __pyx_v_table; __Pyx_INCREF(__pyx_t_10);
    __pyx_t_12 = 0;
    __pyx_t_15 = NULL;
  } else {
    __pyx_t_12 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_table); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1948, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1948, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_15)) {
      if (likely(PyList_CheckExact(__pyx_t_10))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1948, __pyx_L1_error)
          #endif
          if (__pyx_t_12 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1948, __pyx_L1_error)
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1948, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1948, __pyx_L1_error)
          #endif
          if (__pyx_t_12 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1948, __pyx_L1_error)
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1948, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_15(__pyx_t_10);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1948, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "buelon/cython/c_hub.pyx":1949
 * 
 *         for row in table:
 *             row['step'] = get_step(row['id']).to_json()             # <<<<<<<<<<<<<<
 * 
 *         return {
 */
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_get_step); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_16 = __Pyx_PyObject_Dict_GetItem(__pyx_v_row, __pyx_n_s_id); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_17 = NULL;
    __pyx_t_14 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_17)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_17);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_14 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_t_16};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1949, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_to_json); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_14 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_14 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_14, 0+__pyx_t_14);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1949, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    if (unlikely((PyObject_SetItem(__pyx_v_row, __pyx_n_s_step, __pyx_t_7) < 0))) __PYX_ERR(0, 1949, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "buelon/cython/c_hub.pyx":1948
 *         error_size = db.query(error_size_query)[0][0]
 * 
 *         for row in table:             # <<<<<<<<<<<<<<
 *             row['step'] = get_step(row['id']).to_json()
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "buelon/cython/c_hub.pyx":1951
 *             row['step'] = get_step(row['id']).to_json()
 * 
 *         return {             # <<<<<<<<<<<<<<
 *             'total': error_size,
 *             'count': len(table),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "buelon/cython/c_hub.pyx":1952
 * 
 *         return {
 *             'total': error_size,             # <<<<<<<<<<<<<<
 *             'count': len(table),
 *             'table': table
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_total, __pyx_v_error_size) < 0) __PYX_ERR(0, 1952, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1953
 *         return {
 *             'total': error_size,
 *             'count': len(table),             # <<<<<<<<<<<<<<
 *             'table': table
 *         }
 */
  __pyx_t_12 = PyObject_Length(__pyx_v_table); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1953, __pyx_L1_error)
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1954
 *             'total': error_size,
 *             'count': len(table),
 *             'table': table             # <<<<<<<<<<<<<<
 *         }
 * 
 */
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_table, __pyx_v_table) < 0) __PYX_ERR(0, 1952, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1912
 *         db.query('delete from buelon_jobs;')
 * 
 *     def postgres_fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *         try:
 *             count = int(count)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_fetch_errors", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exclude_query);
  __Pyx_XDECREF(__pyx_v_sql);
  __Pyx_XDECREF(__pyx_v_error_size_query);
  __Pyx_XDECREF(__pyx_v_db);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_error_size);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_4generator16);
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubClient_21postgres_fetch_errors_7generator18);
  __Pyx_XDECREF(__pyx_v_count);
  __Pyx_XDECREF(__pyx_v_exclude);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1957
 *         }
 * 
 *     def postgres_repair(self):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

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

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

/* "buelon/cython/c_hub.pyx":1967
 *         parents = [p for s in steps for p in s.parents]
 * 
 *         def get_statuses(ids: list[str]):             # <<<<<<<<<<<<<<
 *             return {
 *                 row['id']: row['status'] for row in
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_1get_statuses(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_1get_statuses = {"get_statuses", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_1get_statuses, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_1get_statuses(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_ids = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_statuses (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ids,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ids)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1967, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_statuses") < 0)) __PYX_ERR(0, 1967, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_ids = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_statuses", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1967, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_repair.get_statuses", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ids), (&PyList_Type), 0, "ids", 1))) __PYX_ERR(0, 1967, __pyx_L1_error)
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_get_statuses(__pyx_self, __pyx_v_ids);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_get_statuses(PyObject *__pyx_self, PyObject *__pyx_v_ids) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *__pyx_cur_scope;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *__pyx_outer_scope;
  PyObject *__pyx_9genexpr45__pyx_v_row = NULL;
  PyObject *__pyx_9genexpr46__pyx_v_i = 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 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_statuses", 1);
  __pyx_outer_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "buelon/cython/c_hub.pyx":1968
 * 
 *         def get_statuses(ids: list[str]):
 *             return {             # <<<<<<<<<<<<<<
 *                 row['id']: row['status'] for row in
 *                 self.db.download_table(sql=f'select id, status from buelon_jobs where id in ('+",".join([f"\'{i}\'" for i in ids])+')')}
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1968, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "buelon/cython/c_hub.pyx":1970
 *             return {
 *                 row['id']: row['status'] for row in
 *                 self.db.download_table(sql=f'select id, status from buelon_jobs where id in ('+",".join([f"\'{i}\'" for i in ids])+')')}             # <<<<<<<<<<<<<<
 * 
 *         parent_statuses = {}
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1970, __pyx_L5_error) }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1970, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_download_table); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1970, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1970, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    { /* enter inner scope */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1970, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_v_ids; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      for (;;) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1970, __pyx_L10_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1970, __pyx_L10_error)
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1970, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_XDECREF_SET(__pyx_9genexpr46__pyx_v_i, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1970, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = 0;
        __pyx_t_9 = 127;
        __Pyx_INCREF(__pyx_kp_u__8);
        __pyx_t_8 += 1;
        __Pyx_GIVEREF(__pyx_kp_u__8);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_u__8);
        __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_9genexpr46__pyx_v_i, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1970, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_9;
        __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_10);
        __pyx_t_10 = 0;
        __Pyx_INCREF(__pyx_kp_u__8);
        __pyx_t_8 += 1;
        __Pyx_GIVEREF(__pyx_kp_u__8);
        PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u__8);
        __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1970, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1970, __pyx_L10_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_i); __pyx_9genexpr46__pyx_v_i = 0;
      goto __pyx_L14_exit_scope;
      __pyx_L10_error:;
      __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_i); __pyx_9genexpr46__pyx_v_i = 0;
      goto __pyx_L5_error;
      __pyx_L14_exit_scope:;
    } /* exit inner scope */
    __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__15, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1970, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_u_select_id_status_from_buelon_job, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1970, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_4, __pyx_kp_s__23); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1970, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sql, __pyx_t_5) < 0) __PYX_ERR(0, 1970, __pyx_L5_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1970, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_6 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1970, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1970, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1970, __pyx_L5_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1970, __pyx_L5_error)
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1970, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1970, __pyx_L5_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1970, __pyx_L5_error)
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1970, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_11(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1970, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr45__pyx_v_row, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "buelon/cython/c_hub.pyx":1969
 *         def get_statuses(ids: list[str]):
 *             return {
 *                 row['id']: row['status'] for row in             # <<<<<<<<<<<<<<
 *                 self.db.download_table(sql=f'select id, status from buelon_jobs where id in ('+",".join([f"\'{i}\'" for i in ids])+')')}
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_9genexpr45__pyx_v_row, __pyx_n_s_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1969, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_9genexpr45__pyx_v_row, __pyx_n_s_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1969, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_t_5, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1969, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_row); __pyx_9genexpr45__pyx_v_row = 0;
    goto __pyx_L16_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_row); __pyx_9genexpr45__pyx_v_row = 0;
    goto __pyx_L1_error;
    __pyx_L16_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "buelon/cython/c_hub.pyx":1967
 *         parents = [p for s in steps for p in s.parents]
 * 
 *         def get_statuses(ids: list[str]):             # <<<<<<<<<<<<<<
 *             return {
 *                 row['id']: row['status'] for row in
 */

  /* 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_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_repair.get_statuses", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_row);
  __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1979
 *                 parent_statuses[p] = parent_statuses.get(p, f'{buelon.core.step.StepStatus.success.value}')
 * 
 *         def should_finish(s: buelon.core.step.Step):             # <<<<<<<<<<<<<<
 *             # return all(parent_statuses[p] in [f'{buelon.core.step.StepStatus.success.value}', f'{buelon.core.step.StepStatus.cancel.value}'] for p in s.parents)
 *             return all(parent_statuses[p] == f'{buelon.core.step.StepStatus.success.value}' for p in s.parents)
 */

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

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_13should_finish_2generator19(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "buelon/cython/c_hub.pyx":1981
 *         def should_finish(s: buelon.core.step.Step):
 *             # return all(parent_statuses[p] in [f'{buelon.core.step.StepStatus.success.value}', f'{buelon.core.step.StepStatus.cancel.value}'] for p in s.parents)
 *             return all(parent_statuses[p] == f'{buelon.core.step.StepStatus.success.value}' for p in s.parents)             # <<<<<<<<<<<<<<
 * 
 *         chunk = []
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_13should_finish_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1981, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_13should_finish_2generator19, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_HubClient_postgres_repair_locals, __pyx_n_s_buelon_cython_c_hub); if (unlikely(!gen)) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_repair.should_finish.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_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_13should_finish_2generator19(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1981, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1981, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1981, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1981, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1981, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1981, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1981, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1981, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1981, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1981, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parent_statuses)) { __Pyx_RaiseClosureNameError("parent_statuses"); __PYX_ERR(0, 1981, __pyx_L1_error) }
    if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parent_statuses == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1981, __pyx_L1_error)
    }
    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_parent_statuses, __pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_success); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_t_5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1981, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = (!__pyx_t_7);
    if (__pyx_t_8) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1979
 *                 parent_statuses[p] = parent_statuses.get(p, f'{buelon.core.step.StepStatus.success.value}')
 * 
 *         def should_finish(s: buelon.core.step.Step):             # <<<<<<<<<<<<<<
 *             # return all(parent_statuses[p] in [f'{buelon.core.step.StepStatus.success.value}', f'{buelon.core.step.StepStatus.cancel.value}'] for p in s.parents)
 *             return all(parent_statuses[p] == f'{buelon.core.step.StepStatus.success.value}' for p in s.parents)
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_2should_finish(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *__pyx_cur_scope;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *__pyx_outer_scope;
  PyObject *__pyx_gb_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_13should_finish_2generator19 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("should_finish", 1);
  __pyx_outer_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "buelon/cython/c_hub.pyx":1981
 *         def should_finish(s: buelon.core.step.Step):
 *             # return all(parent_statuses[p] in [f'{buelon.core.step.StepStatus.success.value}', f'{buelon.core.step.StepStatus.cancel.value}'] for p in s.parents)
 *             return all(parent_statuses[p] == f'{buelon.core.step.StepStatus.success.value}' for p in s.parents)             # <<<<<<<<<<<<<<
 * 
 *         chunk = []
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_parents); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_13should_finish_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1981, __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;

  /* "buelon/cython/c_hub.pyx":1979
 *                 parent_statuses[p] = parent_statuses.get(p, f'{buelon.core.step.StepStatus.success.value}')
 * 
 *         def should_finish(s: buelon.core.step.Step):             # <<<<<<<<<<<<<<
 *             # return all(parent_statuses[p] in [f'{buelon.core.step.StepStatus.success.value}', f'{buelon.core.step.StepStatus.cancel.value}'] for p in s.parents)
 *             return all(parent_statuses[p] == f'{buelon.core.step.StepStatus.success.value}' for p in s.parents)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_repair.should_finish", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_13should_finish_2generator19);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1957
 *         }
 * 
 *     def postgres_repair(self):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_9HubClient_84postgres_repair(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *__pyx_cur_scope;
  PyObject *__pyx_v_rows = NULL;
  PyObject *__pyx_v_ss = NULL;
  PyObject *__pyx_v_steps = NULL;
  PyObject *__pyx_v_parents = NULL;
  PyObject *__pyx_v_get_statuses = 0;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_should_finish = 0;
  PyObject *__pyx_v_chunk = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_9genexpr41__pyx_v_i = NULL;
  PyObject *__pyx_9genexpr42__pyx_v_row = NULL;
  PyObject *__pyx_9genexpr43__pyx_v_d = NULL;
  PyObject *__pyx_9genexpr43__pyx_v_s = NULL;
  PyObject *__pyx_9genexpr44__pyx_v_s = NULL;
  PyObject *__pyx_9genexpr44__pyx_v_p = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("postgres_repair", 0);
  __pyx_cur_scope = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1957, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__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);

  /* "buelon/cython/c_hub.pyx":1958
 * 
 *     def postgres_repair(self):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_HasAttr(__pyx_t_2, __pyx_n_s_db); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1958, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1958, __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, 1958, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (!__pyx_t_4);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1959
 *     def postgres_repair(self):
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()             # <<<<<<<<<<<<<<
 * 
 *         print('Fetching queued (not finished) jobs')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_buelon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_helpers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_postgres); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_postgres_from_env); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1959, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_db, __pyx_t_2) < 0) __PYX_ERR(0, 1959, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "buelon/cython/c_hub.pyx":1958
 * 
 *     def postgres_repair(self):
 *         if not hasattr(self, 'db') or not self.db:             # <<<<<<<<<<<<<<
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":1961
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         print('Fetching queued (not finished) jobs')             # <<<<<<<<<<<<<<
 *         rows = self.db.download_table(sql='select * from buelon_jobs where status =\'2\'')
 *         ss = [bulk_get_step([row['id'] for row in rows[i:i+1000]]) for i in tqdm.tqdm(range(0, len(rows), 1000), desc='Fetching data for jobs by 1,000\'s')]
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1962
 * 
 *         print('Fetching queued (not finished) jobs')
 *         rows = self.db.download_table(sql='select * from buelon_jobs where status =\'2\'')             # <<<<<<<<<<<<<<
 *         ss = [bulk_get_step([row['id'] for row in rows[i:i+1000]]) for i in tqdm.tqdm(range(0, len(rows), 1000), desc='Fetching data for jobs by 1,000\'s')]
 *         steps = [s for d in ss for s in d.values()]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_db); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_download_table); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_sql, __pyx_kp_s_select_from_buelon_jobs_where_st) < 0) __PYX_ERR(0, 1962, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_rows = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "buelon/cython/c_hub.pyx":1963
 *         print('Fetching queued (not finished) jobs')
 *         rows = self.db.download_table(sql='select * from buelon_jobs where status =\'2\'')
 *         ss = [bulk_get_step([row['id'] for row in rows[i:i+1000]]) for i in tqdm.tqdm(range(0, len(rows), 1000), desc='Fetching data for jobs by 1,000\'s')]             # <<<<<<<<<<<<<<
 *         steps = [s for d in ss for s in d.values()]
 *         parents = [p for s in steps for p in s.parents]
 */
  { /* enter inner scope */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1963, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1963, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1963, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = PyObject_Length(__pyx_v_rows); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1963, __pyx_L8_error)
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1963, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1963, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_int_0)) __PYX_ERR(0, 1963, __pyx_L8_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(0, 1963, __pyx_L8_error);
    __Pyx_INCREF(__pyx_int_1000);
    __Pyx_GIVEREF(__pyx_int_1000);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_int_1000)) __PYX_ERR(0, 1963, __pyx_L8_error);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1963, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1963, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2)) __PYX_ERR(0, 1963, __pyx_L8_error);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1963, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_desc, __pyx_kp_s_Fetching_data_for_jobs_by_1_000) < 0) __PYX_ERR(0, 1963, __pyx_L8_error)
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1963, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
      __pyx_t_2 = __pyx_t_10; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_8 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1963, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1963, __pyx_L8_error)
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1963, __pyx_L8_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1963, __pyx_L8_error)
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1963, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1963, __pyx_L8_error)
            #endif
            if (__pyx_t_8 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1963, __pyx_L8_error)
          #else
          __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1963, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_11(__pyx_t_2);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1963, __pyx_L8_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr41__pyx_v_i, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_bulk_get_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1963, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_9);
      { /* enter inner scope */
        __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1963, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_9genexpr41__pyx_v_i, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1963, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyObject_GetSlice(__pyx_v_rows, 0, 0, &__pyx_9genexpr41__pyx_v_i, &__pyx_t_12, NULL, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1963, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (likely(PyList_CheckExact(__pyx_t_13)) || PyTuple_CheckExact(__pyx_t_13)) {
          __pyx_t_12 = __pyx_t_13; __Pyx_INCREF(__pyx_t_12);
          __pyx_t_14 = 0;
          __pyx_t_15 = NULL;
        } else {
          __pyx_t_14 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1963, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1963, __pyx_L13_error)
        }
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        for (;;) {
          if (likely(!__pyx_t_15)) {
            if (likely(PyList_CheckExact(__pyx_t_12))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1963, __pyx_L13_error)
                #endif
                if (__pyx_t_14 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_13 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_14); __Pyx_INCREF(__pyx_t_13); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 1963, __pyx_L13_error)
              #else
              __pyx_t_13 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1963, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_13);
              #endif
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1963, __pyx_L13_error)
                #endif
                if (__pyx_t_14 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_14); __Pyx_INCREF(__pyx_t_13); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 1963, __pyx_L13_error)
              #else
              __pyx_t_13 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1963, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_13);
              #endif
            }
          } else {
            __pyx_t_13 = __pyx_t_15(__pyx_t_12);
            if (unlikely(!__pyx_t_13)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1963, __pyx_L13_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_13);
          }
          __Pyx_XDECREF_SET(__pyx_9genexpr42__pyx_v_row, __pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_13 = __Pyx_PyObject_Dict_GetItem(__pyx_9genexpr42__pyx_v_row, __pyx_n_s_id); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1963, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_13);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 1963, __pyx_L13_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_row); __pyx_9genexpr42__pyx_v_row = 0;
        goto __pyx_L17_exit_scope;
        __pyx_L13_error:;
        __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_row); __pyx_9genexpr42__pyx_v_row = 0;
        goto __pyx_L8_error;
        __pyx_L17_exit_scope:;
      } /* exit inner scope */
      __pyx_t_12 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_6};
        __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1963, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1963, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_i); __pyx_9genexpr41__pyx_v_i = 0;
    goto __pyx_L19_exit_scope;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_i); __pyx_9genexpr41__pyx_v_i = 0;
    goto __pyx_L1_error;
    __pyx_L19_exit_scope:;
  } /* exit inner scope */
  __pyx_v_ss = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "buelon/cython/c_hub.pyx":1964
 *         rows = self.db.download_table(sql='select * from buelon_jobs where status =\'2\'')
 *         ss = [bulk_get_step([row['id'] for row in rows[i:i+1000]]) for i in tqdm.tqdm(range(0, len(rows), 1000), desc='Fetching data for jobs by 1,000\'s')]
 *         steps = [s for d in ss for s in d.values()]             # <<<<<<<<<<<<<<
 *         parents = [p for s in steps for p in s.parents]
 * 
 */
  { /* enter inner scope */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1964, __pyx_L22_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __pyx_v_ss; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_8 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1964, __pyx_L22_error)
        #endif
        if (__pyx_t_8 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1964, __pyx_L22_error)
      #else
      __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1964, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_10);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_d, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_14 = 0;
      if (unlikely(__pyx_9genexpr43__pyx_v_d == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
        __PYX_ERR(0, 1964, __pyx_L22_error)
      }
      __pyx_t_9 = __Pyx_dict_iterator(__pyx_9genexpr43__pyx_v_d, 0, __pyx_n_s_values, (&__pyx_t_16), (&__pyx_t_17)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1964, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_10);
      __pyx_t_10 = __pyx_t_9;
      __pyx_t_9 = 0;
      while (1) {
        __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_10, __pyx_t_16, &__pyx_t_14, NULL, &__pyx_t_9, NULL, __pyx_t_17);
        if (unlikely(__pyx_t_18 == 0)) break;
        if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 1964, __pyx_L22_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_s, __pyx_t_9);
        __pyx_t_9 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_9genexpr43__pyx_v_s))) __PYX_ERR(0, 1964, __pyx_L22_error)
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_d); __pyx_9genexpr43__pyx_v_d = 0;
    __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_s); __pyx_9genexpr43__pyx_v_s = 0;
    goto __pyx_L28_exit_scope;
    __pyx_L22_error:;
    __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_d); __pyx_9genexpr43__pyx_v_d = 0;
    __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_s); __pyx_9genexpr43__pyx_v_s = 0;
    goto __pyx_L1_error;
    __pyx_L28_exit_scope:;
  } /* exit inner scope */
  __pyx_v_steps = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "buelon/cython/c_hub.pyx":1965
 *         ss = [bulk_get_step([row['id'] for row in rows[i:i+1000]]) for i in tqdm.tqdm(range(0, len(rows), 1000), desc='Fetching data for jobs by 1,000\'s')]
 *         steps = [s for d in ss for s in d.values()]
 *         parents = [p for s in steps for p in s.parents]             # <<<<<<<<<<<<<<
 * 
 *         def get_statuses(ids: list[str]):
 */
  { /* enter inner scope */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1965, __pyx_L31_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __pyx_v_steps; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_8 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1965, __pyx_L31_error)
        #endif
        if (__pyx_t_8 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1965, __pyx_L31_error)
      #else
      __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1965, __pyx_L31_error)
      __Pyx_GOTREF(__pyx_t_10);
      #endif
      __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_s, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr44__pyx_v_s, __pyx_n_s_parents); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1965, __pyx_L31_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
        __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9);
        __pyx_t_16 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_16 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1965, __pyx_L31_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1965, __pyx_L31_error)
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      for (;;) {
        if (likely(!__pyx_t_11)) {
          if (likely(PyList_CheckExact(__pyx_t_9))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1965, __pyx_L31_error)
              #endif
              if (__pyx_t_16 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_10 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_16); __Pyx_INCREF(__pyx_t_10); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 1965, __pyx_L31_error)
            #else
            __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1965, __pyx_L31_error)
            __Pyx_GOTREF(__pyx_t_10);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1965, __pyx_L31_error)
              #endif
              if (__pyx_t_16 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_16); __Pyx_INCREF(__pyx_t_10); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 1965, __pyx_L31_error)
            #else
            __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1965, __pyx_L31_error)
            __Pyx_GOTREF(__pyx_t_10);
            #endif
          }
        } else {
          __pyx_t_10 = __pyx_t_11(__pyx_t_9);
          if (unlikely(!__pyx_t_10)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1965, __pyx_L31_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_10);
        }
        __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_p, __pyx_t_10);
        __pyx_t_10 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_9genexpr44__pyx_v_p))) __PYX_ERR(0, 1965, __pyx_L31_error)
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_p); __pyx_9genexpr44__pyx_v_p = 0;
    __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_s); __pyx_9genexpr44__pyx_v_s = 0;
    goto __pyx_L38_exit_scope;
    __pyx_L31_error:;
    __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_p); __pyx_9genexpr44__pyx_v_p = 0;
    __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_s); __pyx_9genexpr44__pyx_v_s = 0;
    goto __pyx_L1_error;
    __pyx_L38_exit_scope:;
  } /* exit inner scope */
  __pyx_v_parents = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "buelon/cython/c_hub.pyx":1967
 *         parents = [p for s in steps for p in s.parents]
 * 
 *         def get_statuses(ids: list[str]):             # <<<<<<<<<<<<<<
 *             return {
 *                 row['id']: row['status'] for row in
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_ids, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 1967, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_1get_statuses, 0, __pyx_n_s_HubClient_postgres_repair_locals_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_get_statuses = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1972
 *                 self.db.download_table(sql=f'select id, status from buelon_jobs where id in ('+",".join([f"\'{i}\'" for i in ids])+')')}
 * 
 *         parent_statuses = {}             # <<<<<<<<<<<<<<
 * 
 *         for i in tqdm.tqdm(range(0, len(parents), 1000), desc='Fetching parents of jobs by 1,000\'s'):
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_parent_statuses = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1974
 *         parent_statuses = {}
 * 
 *         for i in tqdm.tqdm(range(0, len(parents), 1000), desc='Fetching parents of jobs by 1,000\'s'):             # <<<<<<<<<<<<<<
 *             parent_statuses = {**parent_statuses, **get_statuses(parents[i:i + 1000])}
 *             for p in parents[i:i + 1000]:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyList_GET_SIZE(__pyx_v_parents); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1974, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_int_0)) __PYX_ERR(0, 1974, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(0, 1974, __pyx_L1_error);
  __Pyx_INCREF(__pyx_int_1000);
  __Pyx_GIVEREF(__pyx_int_1000);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_int_1000)) __PYX_ERR(0, 1974, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2)) __PYX_ERR(0, 1974, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_desc, __pyx_kp_s_Fetching_parents_of_jobs_by_1_00) < 0) __PYX_ERR(0, 1974, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
    __pyx_t_2 = __pyx_t_10; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_8 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1974, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1974, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1974, __pyx_L1_error)
        #else
        __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1974, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1974, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1974, __pyx_L1_error)
        #else
        __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1974, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        #endif
      }
    } else {
      __pyx_t_10 = __pyx_t_11(__pyx_t_2);
      if (unlikely(!__pyx_t_10)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1974, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_10);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __pyx_t_10 = 0;

    /* "buelon/cython/c_hub.pyx":1975
 * 
 *         for i in tqdm.tqdm(range(0, len(parents), 1000), desc='Fetching parents of jobs by 1,000\'s'):
 *             parent_statuses = {**parent_statuses, **get_statuses(parents[i:i + 1000])}             # <<<<<<<<<<<<<<
 *             for p in parents[i:i + 1000]:
 *                 parent_statuses[p] = parent_statuses.get(p, f'{buelon.core.step.StepStatus.success.value}')
 */
    __pyx_t_10 = PyDict_Copy(__pyx_cur_scope->__pyx_v_parent_statuses); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_i);
    __pyx_t_9 = __pyx_cur_scope->__pyx_v_i;
    __pyx_t_1 = (__pyx_t_9 == Py_None);
    if (__pyx_t_1) {
      __pyx_t_16 = 0;
    } else {
      __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1975, __pyx_L1_error)
      __pyx_t_16 = __pyx_t_14;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_i, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = (__pyx_t_9 == Py_None);
    if (__pyx_t_1) {
      __pyx_t_14 = PY_SSIZE_T_MAX;
    } else {
      __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1975, __pyx_L1_error)
      __pyx_t_14 = __pyx_t_19;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyList_GetSlice(__pyx_v_parents, __pyx_t_16, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_get_statuses(__pyx_v_get_statuses, ((PyObject*)__pyx_t_9)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(__pyx_t_5 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(0, 1975, __pyx_L1_error)
    }
    if (unlikely(PyDict_Update(__pyx_t_10, __pyx_t_5) < 0)) {
      if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseMappingExpectedError(__pyx_t_5);
      __PYX_ERR(0, 1975, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_parent_statuses);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_parent_statuses, ((PyObject*)__pyx_t_10));
    __Pyx_GIVEREF(__pyx_t_10);
    __pyx_t_10 = 0;

    /* "buelon/cython/c_hub.pyx":1976
 *         for i in tqdm.tqdm(range(0, len(parents), 1000), desc='Fetching parents of jobs by 1,000\'s'):
 *             parent_statuses = {**parent_statuses, **get_statuses(parents[i:i + 1000])}
 *             for p in parents[i:i + 1000]:             # <<<<<<<<<<<<<<
 *                 parent_statuses[p] = parent_statuses.get(p, f'{buelon.core.step.StepStatus.success.value}')
 * 
 */
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_i);
    __pyx_t_10 = __pyx_cur_scope->__pyx_v_i;
    __pyx_t_1 = (__pyx_t_10 == Py_None);
    if (__pyx_t_1) {
      __pyx_t_14 = 0;
    } else {
      __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1976, __pyx_L1_error)
      __pyx_t_14 = __pyx_t_16;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_i, __pyx_int_1000, 0x3E8, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = (__pyx_t_10 == Py_None);
    if (__pyx_t_1) {
      __pyx_t_16 = PY_SSIZE_T_MAX;
    } else {
      __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1976, __pyx_L1_error)
      __pyx_t_16 = __pyx_t_19;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyList_GetSlice(__pyx_v_parents, __pyx_t_14, __pyx_t_16); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_5 = __pyx_t_10; __Pyx_INCREF(__pyx_t_5);
    __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1976, __pyx_L1_error)
        #endif
        if (__pyx_t_16 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_16); __Pyx_INCREF(__pyx_t_10); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 1976, __pyx_L1_error)
      #else
      __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "buelon/cython/c_hub.pyx":1977
 *             parent_statuses = {**parent_statuses, **get_statuses(parents[i:i + 1000])}
 *             for p in parents[i:i + 1000]:
 *                 parent_statuses[p] = parent_statuses.get(p, f'{buelon.core.step.StepStatus.success.value}')             # <<<<<<<<<<<<<<
 * 
 *         def should_finish(s: buelon.core.step.Step):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_buelon); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_core); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_step); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_success); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_cur_scope->__pyx_v_parent_statuses, __pyx_v_p, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_v_parent_statuses, __pyx_v_p, __pyx_t_9) < 0))) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "buelon/cython/c_hub.pyx":1976
 *         for i in tqdm.tqdm(range(0, len(parents), 1000), desc='Fetching parents of jobs by 1,000\'s'):
 *             parent_statuses = {**parent_statuses, **get_statuses(parents[i:i + 1000])}
 *             for p in parents[i:i + 1000]:             # <<<<<<<<<<<<<<
 *                 parent_statuses[p] = parent_statuses.get(p, f'{buelon.core.step.StepStatus.success.value}')
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "buelon/cython/c_hub.pyx":1974
 *         parent_statuses = {}
 * 
 *         for i in tqdm.tqdm(range(0, len(parents), 1000), desc='Fetching parents of jobs by 1,000\'s'):             # <<<<<<<<<<<<<<
 *             parent_statuses = {**parent_statuses, **get_statuses(parents[i:i + 1000])}
 *             for p in parents[i:i + 1000]:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1979
 *                 parent_statuses[p] = parent_statuses.get(p, f'{buelon.core.step.StepStatus.success.value}')
 * 
 *         def should_finish(s: buelon.core.step.Step):             # <<<<<<<<<<<<<<
 *             # return all(parent_statuses[p] in [f'{buelon.core.step.StepStatus.success.value}', f'{buelon.core.step.StepStatus.cancel.value}'] for p in s.parents)
 *             return all(parent_statuses[p] == f'{buelon.core.step.StepStatus.success.value}' for p in s.parents)
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_s, __pyx_kp_s_buelon_core_step_Step) < 0) __PYX_ERR(0, 1979, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_3should_finish, 0, __pyx_n_s_HubClient_postgres_repair_locals_3, ((PyObject*)__pyx_cur_scope), __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_should_finish = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "buelon/cython/c_hub.pyx":1983
 *             return all(parent_statuses[p] == f'{buelon.core.step.StepStatus.success.value}' for p in s.parents)
 * 
 *         chunk = []             # <<<<<<<<<<<<<<
 *         for s in tqdm.tqdm(steps, desc='Repairing Steps (Commits every 1,000 repairs)'):
 *             if should_finish(s):
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_chunk = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "buelon/cython/c_hub.pyx":1984
 * 
 *         chunk = []
 *         for s in tqdm.tqdm(steps, desc='Repairing Steps (Commits every 1,000 repairs)'):             # <<<<<<<<<<<<<<
 *             if should_finish(s):
 *                 chunk.append(s)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_steps);
  __Pyx_GIVEREF(__pyx_v_steps);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_steps)) __PYX_ERR(0, 1984, __pyx_L1_error);
  __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_desc, __pyx_kp_s_Repairing_Steps_Commits_every_1) < 0) __PYX_ERR(0, 1984, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
    __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9);
    __pyx_t_8 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1984, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_9))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1984, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1984, __pyx_L1_error)
        #else
        __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1984, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1984, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1984, __pyx_L1_error)
        #else
        __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1984, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        #endif
      }
    } else {
      __pyx_t_10 = __pyx_t_11(__pyx_t_9);
      if (unlikely(!__pyx_t_10)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1984, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_10);
    }
    __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "buelon/cython/c_hub.pyx":1985
 *         chunk = []
 *         for s in tqdm.tqdm(steps, desc='Repairing Steps (Commits every 1,000 repairs)'):
 *             if should_finish(s):             # <<<<<<<<<<<<<<
 *                 chunk.append(s)
 *                 if len(chunk) >= 1000:
 */
    __pyx_t_10 = __pyx_pf_6buelon_6cython_5c_hub_9HubClient_15postgres_repair_2should_finish(__pyx_v_should_finish, __pyx_v_s); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1985, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1985, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (__pyx_t_1) {

      /* "buelon/cython/c_hub.pyx":1986
 *         for s in tqdm.tqdm(steps, desc='Repairing Steps (Commits every 1,000 repairs)'):
 *             if should_finish(s):
 *                 chunk.append(s)             # <<<<<<<<<<<<<<
 *                 if len(chunk) >= 1000:
 *                     self.dones(chunk)
 */
      __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_chunk, __pyx_v_s); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 1986, __pyx_L1_error)

      /* "buelon/cython/c_hub.pyx":1987
 *             if should_finish(s):
 *                 chunk.append(s)
 *                 if len(chunk) >= 1000:             # <<<<<<<<<<<<<<
 *                     self.dones(chunk)
 *                     chunk = []
 */
      __pyx_t_16 = __Pyx_PyList_GET_SIZE(__pyx_v_chunk); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1987, __pyx_L1_error)
      __pyx_t_1 = (__pyx_t_16 >= 0x3E8);
      if (__pyx_t_1) {

        /* "buelon/cython/c_hub.pyx":1988
 *                 chunk.append(s)
 *                 if len(chunk) >= 1000:
 *                     self.dones(chunk)             # <<<<<<<<<<<<<<
 *                     chunk = []
 *         if chunk:
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_dones); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1988, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_chunk};
          __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1988, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "buelon/cython/c_hub.pyx":1989
 *                 if len(chunk) >= 1000:
 *                     self.dones(chunk)
 *                     chunk = []             # <<<<<<<<<<<<<<
 *         if chunk:
 *             self.dones(chunk)
 */
        __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF_SET(__pyx_v_chunk, ((PyObject*)__pyx_t_10));
        __pyx_t_10 = 0;

        /* "buelon/cython/c_hub.pyx":1987
 *             if should_finish(s):
 *                 chunk.append(s)
 *                 if len(chunk) >= 1000:             # <<<<<<<<<<<<<<
 *                     self.dones(chunk)
 *                     chunk = []
 */
      }

      /* "buelon/cython/c_hub.pyx":1985
 *         chunk = []
 *         for s in tqdm.tqdm(steps, desc='Repairing Steps (Commits every 1,000 repairs)'):
 *             if should_finish(s):             # <<<<<<<<<<<<<<
 *                 chunk.append(s)
 *                 if len(chunk) >= 1000:
 */
    }

    /* "buelon/cython/c_hub.pyx":1984
 * 
 *         chunk = []
 *         for s in tqdm.tqdm(steps, desc='Repairing Steps (Commits every 1,000 repairs)'):             # <<<<<<<<<<<<<<
 *             if should_finish(s):
 *                 chunk.append(s)
 */
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "buelon/cython/c_hub.pyx":1990
 *                     self.dones(chunk)
 *                     chunk = []
 *         if chunk:             # <<<<<<<<<<<<<<
 *             self.dones(chunk)
 * 
 */
  __pyx_t_1 = (PyList_GET_SIZE(__pyx_v_chunk) != 0);
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1991
 *                     chunk = []
 *         if chunk:
 *             self.dones(chunk)             # <<<<<<<<<<<<<<
 * 
 *     def __getattr__(self, item: str):
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_dones); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_chunk};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "buelon/cython/c_hub.pyx":1990
 *                     self.dones(chunk)
 *                     chunk = []
 *         if chunk:             # <<<<<<<<<<<<<<
 *             self.dones(chunk)
 * 
 */
  }

  /* "buelon/cython/c_hub.pyx":1957
 *         }
 * 
 *     def postgres_repair(self):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.postgres_repair", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rows);
  __Pyx_XDECREF(__pyx_v_ss);
  __Pyx_XDECREF(__pyx_v_steps);
  __Pyx_XDECREF(__pyx_v_parents);
  __Pyx_XDECREF(__pyx_v_get_statuses);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_should_finish);
  __Pyx_XDECREF(__pyx_v_chunk);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_i);
  __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_row);
  __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_d);
  __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_s);
  __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_s);
  __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_p);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":1993
 *             self.dones(chunk)
 * 
 *     def __getattr__(self, item: str):             # <<<<<<<<<<<<<<
 *         if item.startswith('sync_'):
 *             if hasattr(self, item[5:]):
 */

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

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

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

  /* "buelon/cython/c_hub.pyx":1994
 * 
 *     def __getattr__(self, item: str):
 *         if item.startswith('sync_'):             # <<<<<<<<<<<<<<
 *             if hasattr(self, item[5:]):
 *                 return getattr(self, item[5:])
 */
  __pyx_t_1 = __Pyx_PyStr_Tailmatch(__pyx_v_item, __pyx_n_s_sync, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1994, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "buelon/cython/c_hub.pyx":1995
 *     def __getattr__(self, item: str):
 *         if item.startswith('sync_'):
 *             if hasattr(self, item[5:]):             # <<<<<<<<<<<<<<
 *                 return getattr(self, item[5:])
 *         raise AttributeError('')
 */
    __pyx_t_2 = PySequence_GetSlice(__pyx_v_item, 5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_HasAttr(__pyx_v_self, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1995, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "buelon/cython/c_hub.pyx":1996
 *         if item.startswith('sync_'):
 *             if hasattr(self, item[5:]):
 *                 return getattr(self, item[5:])             # <<<<<<<<<<<<<<
 *         raise AttributeError('')
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PySequence_GetSlice(__pyx_v_item, 5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1996, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_GetAttr(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1996, __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;

      /* "buelon/cython/c_hub.pyx":1995
 *     def __getattr__(self, item: str):
 *         if item.startswith('sync_'):
 *             if hasattr(self, item[5:]):             # <<<<<<<<<<<<<<
 *                 return getattr(self, item[5:])
 *         raise AttributeError('')
 */
    }

    /* "buelon/cython/c_hub.pyx":1994
 * 
 *     def __getattr__(self, item: str):
 *         if item.startswith('sync_'):             # <<<<<<<<<<<<<<
 *             if hasattr(self, item[5:]):
 *                 return getattr(self, item[5:])
 */
  }

  /* "buelon/cython/c_hub.pyx":1997
 *             if hasattr(self, item[5:]):
 *                 return getattr(self, item[5:])
 *         raise AttributeError('')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1997, __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, 1997, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1993
 *             self.dones(chunk)
 * 
 *     def __getattr__(self, item: str):             # <<<<<<<<<<<<<<
 *         if item.startswith('sync_'):
 *             if hasattr(self, item[5:]):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("buelon.cython.c_hub.HubClient.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "buelon/cython/c_hub.pyx":2000
 * 
 * 
 * def main():             # <<<<<<<<<<<<<<
 *     """
 *     Main function to start the server and worker thread.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_83main(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_6buelon_6cython_5c_hub_82main, "\n    Main function to start the server and worker thread.\n\n    Handles keyboard interruption to shut down the server gracefully.\n    ");
static PyMethodDef __pyx_mdef_6buelon_6cython_5c_hub_83main = {"main", (PyCFunction)__pyx_pw_6buelon_6cython_5c_hub_83main, METH_NOARGS, __pyx_doc_6buelon_6cython_5c_hub_82main};
static PyObject *__pyx_pw_6buelon_6cython_5c_hub_83main(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("main (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_6buelon_6cython_5c_hub_82main(__pyx_self);

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

static PyObject *__pyx_pf_6buelon_6cython_5c_hub_82main(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_server = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("main", 1);

  /* "buelon/cython/c_hub.pyx":2006
 *     Handles keyboard interruption to shut down the server gracefully.
 *     """
 *     load_db()             # <<<<<<<<<<<<<<
 * 
 *     server = HubServer()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_load_db); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2006, __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;

  /* "buelon/cython/c_hub.pyx":2008
 *     load_db()
 * 
 *     server = HubServer()             # <<<<<<<<<<<<<<
 *     server.start()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_HubServer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_server = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "buelon/cython/c_hub.pyx":2009
 * 
 *     server = HubServer()
 *     server.start()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2009, __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;

  /* "buelon/cython/c_hub.pyx":2000
 * 
 * 
 * def main():             # <<<<<<<<<<<<<<
 *     """
 *     Main function to start the server and worker thread.
 */

  /* 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("buelon.cython.c_hub.main", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_server);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_CustomTimeoutError);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func *)o;
  if (p->__pyx_v_CustomTimeoutError) {
    e = (*v)(p->__pyx_v_CustomTimeoutError, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func *)o;
  tmp = ((PyObject*)p->__pyx_v_CustomTimeoutError);
  p->__pyx_v_CustomTimeoutError = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func},
  {Py_tp_clear, (void *)__pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct__timeout_func",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct__timeout_func", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func, /*tp_traverse*/
  __pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_row);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_row) {
    e = (*v)(p->__pyx_v_row, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_1_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_allow_chars);
  Py_CLEAR(p->__pyx_v_clean_query_string);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *)o;
  if (p->__pyx_v_allow_chars) {
    e = (*v)(p->__pyx_v_allow_chars, a); if (e) return e;
  }
  if (p->__pyx_v_clean_query_string) {
    e = (*v)(p->__pyx_v_clean_query_string, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors *)o;
  tmp = ((PyObject*)p->__pyx_v_allow_chars);
  p->__pyx_v_allow_chars = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_clean_query_string);
  p->__pyx_v_clean_query_string = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors},
  {Py_tp_clear, (void *)__pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_2__fetch_errors",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_2__fetch_errors", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors, /*tp_traverse*/
  __pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_x);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_3_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_3_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_c);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_c) {
    e = (*v)(p->__pyx_v_c, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_4_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_4_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_5_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_5_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr *)o;
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_6_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_6_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_json_table);
  Py_CLEAR(p->__pyx_v_params);
  Py_CLEAR(p->__pyx_v_query);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query *)o;
  if (p->__pyx_v_json_table) {
    e = (*v)(p->__pyx_v_json_table, a); if (e) return e;
  }
  if (p->__pyx_v_params) {
    e = (*v)(p->__pyx_v_params, a); if (e) return e;
  }
  if (p->__pyx_v_query) {
    e = (*v)(p->__pyx_v_query, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query *)o;
  tmp = ((PyObject*)p->__pyx_v_json_table);
  p->__pyx_v_json_table = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_params);
  p->__pyx_v_params = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_query);
  p->__pyx_v_query = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query},
  {Py_tp_clear, (void *)__pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_7_execute_db_query",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_7_execute_db_query", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query, /*tp_traverse*/
  __pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_x);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_8_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_8_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v__);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v__) {
    e = (*v)(p->__pyx_v__, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_9_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_9_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v__);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v__) {
    e = (*v)(p->__pyx_v__, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_10_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_10_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_11_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_11_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v__id);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v__id) {
    e = (*v)(p->__pyx_v__id, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_12_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_12_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_13_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_13_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v__id);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v__id) {
    e = (*v)(p->__pyx_v__id, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_14_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_14_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_15_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_15_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_16_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_16_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_17_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_17_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_s);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_s) {
    e = (*v)(p->__pyx_v_s, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_18_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_18_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___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
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_allow_chars);
  Py_CLEAR(p->__pyx_v_clean_query_string);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *)o;
  if (p->__pyx_v_allow_chars) {
    e = (*v)(p->__pyx_v_allow_chars, a); if (e) return e;
  }
  if (p->__pyx_v_clean_query_string) {
    e = (*v)(p->__pyx_v_clean_query_string, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors *)o;
  tmp = ((PyObject*)p->__pyx_v_allow_chars);
  p->__pyx_v_allow_chars = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_clean_query_string);
  p->__pyx_v_clean_query_string = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors},
  {Py_tp_clear, (void *)__pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_19_postgres_fetch_errors",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_19_postgres_fetch_errors", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors, /*tp_traverse*/
  __pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_x);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_20_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_20_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_c);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_c) {
    e = (*v)(p->__pyx_v_c, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_21_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_21_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_22_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_22_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_v_parent_statuses);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *)o;
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_v_parent_statuses) {
    e = (*v)(p->__pyx_v_parent_statuses, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair *)o;
  tmp = ((PyObject*)p->__pyx_v_i);
  p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_parent_statuses);
  p->__pyx_v_parent_statuses = ((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);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair},
  {Py_tp_clear, (void *)__pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_23_postgres_repair",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_23_postgres_repair", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair, /*tp_traverse*/
  __pyx_tp_clear_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr *__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr[8];
static int __pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr[--__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr(PyObject *o) {
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_p);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr)))) {
    __pyx_freelist_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr[__pyx_freecount_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr++] = ((struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr *p = (struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_p) {
    e = (*v)(p->__pyx_v_p, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr_spec = {
  "buelon.cython.c_hub.__pyx_scope_struct_24_genexpr",
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "buelon.cython.c_hub.""__pyx_scope_struct_24_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif
/* #### Code section: pystring_table ### */

static int __Pyx_CreateStringTabAndInitStrings(void) {
  __Pyx_StringTabEntry __pyx_string_tab[] = {
    {&__pyx_kp_u_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 1, 0, 0},
    {&__pyx_kp_s_0_0_0_0, __pyx_k_0_0_0_0, sizeof(__pyx_k_0_0_0_0), 0, 0, 1, 0},
    {&__pyx_n_s_AF_INET, __pyx_k_AF_INET, sizeof(__pyx_k_AF_INET), 0, 0, 1, 1},
    {&__pyx_kp_s_AND_not, __pyx_k_AND_not, sizeof(__pyx_k_AND_not), 0, 0, 1, 0},
    {&__pyx_kp_u_AND_not_lower_msg_like, __pyx_k_AND_not_lower_msg_like, sizeof(__pyx_k_AND_not_lower_msg_like), 0, 1, 0, 0},
    {&__pyx_kp_u_AND_s_status, __pyx_k_AND_s_status, sizeof(__pyx_k_AND_s_status), 0, 1, 0, 0},
    {&__pyx_kp_u_AND_s_status_2, __pyx_k_AND_s_status_2, sizeof(__pyx_k_AND_s_status_2), 0, 1, 0, 0},
    {&__pyx_kp_u_AND_s_status_3, __pyx_k_AND_s_status_3, sizeof(__pyx_k_AND_s_status_3), 0, 1, 0, 0},
    {&__pyx_kp_u_AND_status, __pyx_k_AND_status, sizeof(__pyx_k_AND_status), 0, 1, 0, 0},
    {&__pyx_kp_u_AND_status_2, __pyx_k_AND_status_2, sizeof(__pyx_k_AND_status_2), 0, 1, 0, 0},
    {&__pyx_n_s_Any, __pyx_k_Any, sizeof(__pyx_k_Any), 0, 0, 1, 1},
    {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
    {&__pyx_n_s_CANCEL, __pyx_k_CANCEL, sizeof(__pyx_k_CANCEL), 0, 0, 1, 1},
    {&__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s, __pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s, sizeof(__pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s), 0, 0, 1, 0},
    {&__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_2, __pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_2, sizeof(__pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_2), 0, 0, 1, 0},
    {&__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_3, __pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_3, sizeof(__pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_3), 0, 0, 1, 0},
    {&__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_4, __pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_4, sizeof(__pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_4), 0, 0, 1, 0},
    {&__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_5, __pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_5, sizeof(__pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_5), 0, 0, 1, 0},
    {&__pyx_kp_s_CREATE_INDEX_IF_NOT_EXISTS_idx_s_6, __pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_6, sizeof(__pyx_k_CREATE_INDEX_IF_NOT_EXISTS_idx_s_6), 0, 0, 1, 0},
    {&__pyx_kp_s_CREATE_INDEX_if_not_exists_idx_b, __pyx_k_CREATE_INDEX_if_not_exists_idx_b, sizeof(__pyx_k_CREATE_INDEX_if_not_exists_idx_b), 0, 0, 1, 0},
    {&__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo, __pyx_k_CREATE_TABLE_IF_NOT_EXISTS_buelo, sizeof(__pyx_k_CREATE_TABLE_IF_NOT_EXISTS_buelo), 0, 0, 1, 0},
    {&__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_2, __pyx_k_CREATE_TABLE_IF_NOT_EXISTS_buelo_2, sizeof(__pyx_k_CREATE_TABLE_IF_NOT_EXISTS_buelo_2), 0, 0, 1, 0},
    {&__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_buelo_3, __pyx_k_CREATE_TABLE_IF_NOT_EXISTS_buelo_3, sizeof(__pyx_k_CREATE_TABLE_IF_NOT_EXISTS_buelo_3), 0, 0, 1, 0},
    {&__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_steps, __pyx_k_CREATE_TABLE_IF_NOT_EXISTS_steps, sizeof(__pyx_k_CREATE_TABLE_IF_NOT_EXISTS_steps), 0, 0, 1, 0},
    {&__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags, __pyx_k_CREATE_TABLE_IF_NOT_EXISTS_tags, sizeof(__pyx_k_CREATE_TABLE_IF_NOT_EXISTS_tags), 0, 0, 1, 0},
    {&__pyx_kp_s_CREATE_TABLE_IF_NOT_EXISTS_tags_2, __pyx_k_CREATE_TABLE_IF_NOT_EXISTS_tags_2, sizeof(__pyx_k_CREATE_TABLE_IF_NOT_EXISTS_tags_2), 0, 0, 1, 0},
    {&__pyx_kp_s_CREATE_UNIQUE_INDEX_IF_NOT_EXIST, __pyx_k_CREATE_UNIQUE_INDEX_IF_NOT_EXIST, sizeof(__pyx_k_CREATE_UNIQUE_INDEX_IF_NOT_EXIST), 0, 0, 1, 0},
    {&__pyx_n_s_Callable, __pyx_k_Callable, sizeof(__pyx_k_Callable), 0, 0, 1, 1},
    {&__pyx_n_s_Client, __pyx_k_Client, sizeof(__pyx_k_Client), 0, 0, 1, 1},
    {&__pyx_n_s_ConnectionRefusedError, __pyx_k_ConnectionRefusedError, sizeof(__pyx_k_ConnectionRefusedError), 0, 0, 1, 1},
    {&__pyx_n_s_CustomTimeoutError, __pyx_k_CustomTimeoutError, sizeof(__pyx_k_CustomTimeoutError), 0, 0, 1, 1},
    {&__pyx_n_s_DEFAULT_SCOPES, __pyx_k_DEFAULT_SCOPES, sizeof(__pyx_k_DEFAULT_SCOPES), 0, 0, 1, 1},
    {&__pyx_n_s_DELETE_STEPS, __pyx_k_DELETE_STEPS, sizeof(__pyx_k_DELETE_STEPS), 0, 0, 1, 1},
    {&__pyx_n_s_DONE, __pyx_k_DONE, sizeof(__pyx_k_DONE), 0, 0, 1, 1},
    {&__pyx_n_s_Done, __pyx_k_Done, sizeof(__pyx_k_Done), 0, 0, 1, 1},
    {&__pyx_n_s_ERROR, __pyx_k_ERROR, sizeof(__pyx_k_ERROR), 0, 0, 1, 1},
    {&__pyx_n_s_Enum, __pyx_k_Enum, sizeof(__pyx_k_Enum), 0, 0, 1, 1},
    {&__pyx_kp_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 0},
    {&__pyx_kp_u_Error_processing_transaction, __pyx_k_Error_processing_transaction, sizeof(__pyx_k_Error_processing_transaction), 0, 1, 0, 0},
    {&__pyx_kp_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 0},
    {&__pyx_n_s_FETCH_ERRORS, __pyx_k_FETCH_ERRORS, sizeof(__pyx_k_FETCH_ERRORS), 0, 0, 1, 1},
    {&__pyx_n_s_FETCH_ROWS, __pyx_k_FETCH_ROWS, sizeof(__pyx_k_FETCH_ROWS), 0, 0, 1, 1},
    {&__pyx_kp_u_FOR_UPDATE_SKIP_LOCKED, __pyx_k_FOR_UPDATE_SKIP_LOCKED, sizeof(__pyx_k_FOR_UPDATE_SKIP_LOCKED), 0, 1, 0, 0},
    {&__pyx_kp_u_FOR_UPDATE_SKIP_LOCKED_RETURNIN, __pyx_k_FOR_UPDATE_SKIP_LOCKED_RETURNIN, sizeof(__pyx_k_FOR_UPDATE_SKIP_LOCKED_RETURNIN), 0, 1, 0, 0},
    {&__pyx_kp_s_Fetching_data_for_jobs_by_1_000, __pyx_k_Fetching_data_for_jobs_by_1_000, sizeof(__pyx_k_Fetching_data_for_jobs_by_1_000), 0, 0, 1, 0},
    {&__pyx_kp_s_Fetching_parents_of_jobs_by_1_00, __pyx_k_Fetching_parents_of_jobs_by_1_00, sizeof(__pyx_k_Fetching_parents_of_jobs_by_1_00), 0, 0, 1, 0},
    {&__pyx_kp_s_Fetching_queued_not_finished_job, __pyx_k_Fetching_queued_not_finished_job, sizeof(__pyx_k_Fetching_queued_not_finished_job), 0, 0, 1, 0},
    {&__pyx_n_s_GET_STEPS, __pyx_k_GET_STEPS, sizeof(__pyx_k_GET_STEPS), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient, __pyx_k_HubClient, sizeof(__pyx_k_HubClient), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient___enter, __pyx_k_HubClient___enter, sizeof(__pyx_k_HubClient___enter), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient___exit, __pyx_k_HubClient___exit, sizeof(__pyx_k_HubClient___exit), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient___getattr, __pyx_k_HubClient___getattr, sizeof(__pyx_k_HubClient___getattr), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient___init, __pyx_k_HubClient___init, sizeof(__pyx_k_HubClient___init), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient__already, __pyx_k_HubClient__already, sizeof(__pyx_k_HubClient__already), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_cancel, __pyx_k_HubClient_cancel, sizeof(__pyx_k_HubClient_cancel), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_cancels, __pyx_k_HubClient_cancels, sizeof(__pyx_k_HubClient_cancels), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_close, __pyx_k_HubClient_close, sizeof(__pyx_k_HubClient_close), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_connect, __pyx_k_HubClient_connect, sizeof(__pyx_k_HubClient_connect), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_delete_steps, __pyx_k_HubClient_delete_steps, sizeof(__pyx_k_HubClient_delete_steps), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_done, __pyx_k_HubClient_done, sizeof(__pyx_k_HubClient_done), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_dones, __pyx_k_HubClient_dones, sizeof(__pyx_k_HubClient_dones), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_error, __pyx_k_HubClient_error, sizeof(__pyx_k_HubClient_error), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_fetch_errors, __pyx_k_HubClient_fetch_errors, sizeof(__pyx_k_HubClient_fetch_errors), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_get_rows, __pyx_k_HubClient_get_rows, sizeof(__pyx_k_HubClient_get_rows), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_get_step_count, __pyx_k_HubClient_get_step_count, sizeof(__pyx_k_HubClient_get_step_count), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_get_steps, __pyx_k_HubClient_get_steps, sizeof(__pyx_k_HubClient_get_steps), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_load_pg, __pyx_k_HubClient_load_pg, sizeof(__pyx_k_HubClient_load_pg), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_pending, __pyx_k_HubClient_pending, sizeof(__pyx_k_HubClient_pending), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_pendings, __pyx_k_HubClient_pendings, sizeof(__pyx_k_HubClient_pendings), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_cancel, __pyx_k_HubClient_postgres_cancel, sizeof(__pyx_k_HubClient_postgres_cancel), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_cancels, __pyx_k_HubClient_postgres_cancels, sizeof(__pyx_k_HubClient_postgres_cancels), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_cancels_local, __pyx_k_HubClient_postgres_cancels_local, sizeof(__pyx_k_HubClient_postgres_cancels_local), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_delete_steps, __pyx_k_HubClient_postgres_delete_steps, sizeof(__pyx_k_HubClient_postgres_delete_steps), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_done, __pyx_k_HubClient_postgres_done, sizeof(__pyx_k_HubClient_postgres_done), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_done_locals_g, __pyx_k_HubClient_postgres_done_locals_g, sizeof(__pyx_k_HubClient_postgres_done_locals_g), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_dones, __pyx_k_HubClient_postgres_dones, sizeof(__pyx_k_HubClient_postgres_dones), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_dones_locals, __pyx_k_HubClient_postgres_dones_locals, sizeof(__pyx_k_HubClient_postgres_dones_locals), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_error, __pyx_k_HubClient_postgres_error, sizeof(__pyx_k_HubClient_postgres_error), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_fetch_errors, __pyx_k_HubClient_postgres_fetch_errors, sizeof(__pyx_k_HubClient_postgres_fetch_errors), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_fetch_errors_2, __pyx_k_HubClient_postgres_fetch_errors_2, sizeof(__pyx_k_HubClient_postgres_fetch_errors_2), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_fetch_errors_3, __pyx_k_HubClient_postgres_fetch_errors_3, sizeof(__pyx_k_HubClient_postgres_fetch_errors_3), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_fetch_errors_4, __pyx_k_HubClient_postgres_fetch_errors_4, sizeof(__pyx_k_HubClient_postgres_fetch_errors_4), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_get_rows, __pyx_k_HubClient_postgres_get_rows, sizeof(__pyx_k_HubClient_postgres_get_rows), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_get_step_coun, __pyx_k_HubClient_postgres_get_step_coun, sizeof(__pyx_k_HubClient_postgres_get_step_coun), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_get_steps, __pyx_k_HubClient_postgres_get_steps, sizeof(__pyx_k_HubClient_postgres_get_steps), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_get_steps_loc, __pyx_k_HubClient_postgres_get_steps_loc, sizeof(__pyx_k_HubClient_postgres_get_steps_loc), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_get_steps_loc_2, __pyx_k_HubClient_postgres_get_steps_loc_2, sizeof(__pyx_k_HubClient_postgres_get_steps_loc_2), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_pending, __pyx_k_HubClient_postgres_pending, sizeof(__pyx_k_HubClient_postgres_pending), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_pendings, __pyx_k_HubClient_postgres_pendings, sizeof(__pyx_k_HubClient_postgres_pendings), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_pendings_loca, __pyx_k_HubClient_postgres_pendings_loca, sizeof(__pyx_k_HubClient_postgres_pendings_loca), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_repair, __pyx_k_HubClient_postgres_repair, sizeof(__pyx_k_HubClient_postgres_repair), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_repair_locals, __pyx_k_HubClient_postgres_repair_locals, sizeof(__pyx_k_HubClient_postgres_repair_locals), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_repair_locals_2, __pyx_k_HubClient_postgres_repair_locals_2, sizeof(__pyx_k_HubClient_postgres_repair_locals_2), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_repair_locals_3, __pyx_k_HubClient_postgres_repair_locals_3, sizeof(__pyx_k_HubClient_postgres_repair_locals_3), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_reset, __pyx_k_HubClient_postgres_reset, sizeof(__pyx_k_HubClient_postgres_reset), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_reset_errors, __pyx_k_HubClient_postgres_reset_errors, sizeof(__pyx_k_HubClient_postgres_reset_errors), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_resets, __pyx_k_HubClient_postgres_resets, sizeof(__pyx_k_HubClient_postgres_resets), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_resets_locals, __pyx_k_HubClient_postgres_resets_locals, sizeof(__pyx_k_HubClient_postgres_resets_locals), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_upload_step, __pyx_k_HubClient_postgres_upload_step, sizeof(__pyx_k_HubClient_postgres_upload_step), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_postgres_upload_steps, __pyx_k_HubClient_postgres_upload_steps, sizeof(__pyx_k_HubClient_postgres_upload_steps), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_repair, __pyx_k_HubClient_repair, sizeof(__pyx_k_HubClient_repair), 0, 0, 1, 1},
    {&__pyx_kp_s_HubClient_repair_is_only_impleme, __pyx_k_HubClient_repair_is_only_impleme, sizeof(__pyx_k_HubClient_repair_is_only_impleme), 0, 0, 1, 0},
    {&__pyx_n_s_HubClient_reset, __pyx_k_HubClient_reset, sizeof(__pyx_k_HubClient_reset), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_reset_errors, __pyx_k_HubClient_reset_errors, sizeof(__pyx_k_HubClient_reset_errors), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_resets, __pyx_k_HubClient_resets, sizeof(__pyx_k_HubClient_resets), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_send_request, __pyx_k_HubClient_send_request, sizeof(__pyx_k_HubClient_send_request), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_upload_step, __pyx_k_HubClient_upload_step, sizeof(__pyx_k_HubClient_upload_step), 0, 0, 1, 1},
    {&__pyx_n_s_HubClient_upload_steps, __pyx_k_HubClient_upload_steps, sizeof(__pyx_k_HubClient_upload_steps), 0, 0, 1, 1},
    {&__pyx_kp_s_HubClient_used_outside_the_main, __pyx_k_HubClient_used_outside_the_main, sizeof(__pyx_k_HubClient_used_outside_the_main), 0, 0, 1, 0},
    {&__pyx_n_s_HubServer, __pyx_k_HubServer, sizeof(__pyx_k_HubServer), 0, 0, 1, 1},
    {&__pyx_n_s_HubServer___init, __pyx_k_HubServer___init, sizeof(__pyx_k_HubServer___init), 0, 0, 1, 1},
    {&__pyx_n_s_HubServer__execute_request, __pyx_k_HubServer__execute_request, sizeof(__pyx_k_HubServer__execute_request), 0, 0, 1, 1},
    {&__pyx_n_s_HubServer__execute_transaction, __pyx_k_HubServer__execute_transaction, sizeof(__pyx_k_HubServer__execute_transaction), 0, 0, 1, 1},
    {&__pyx_n_s_HubServer__handle_client, __pyx_k_HubServer__handle_client, sizeof(__pyx_k_HubServer__handle_client), 0, 0, 1, 1},
    {&__pyx_n_s_HubServer__process_request, __pyx_k_HubServer__process_request, sizeof(__pyx_k_HubServer__process_request), 0, 0, 1, 1},
    {&__pyx_n_s_HubServer__process_request_local, __pyx_k_HubServer__process_request_local, sizeof(__pyx_k_HubServer__process_request_local), 0, 0, 1, 1},
    {&__pyx_n_s_HubServer__process_transactions, __pyx_k_HubServer__process_transactions, sizeof(__pyx_k_HubServer__process_transactions), 0, 0, 1, 1},
    {&__pyx_n_s_HubServer_create_db_pool, __pyx_k_HubServer_create_db_pool, sizeof(__pyx_k_HubServer_create_db_pool), 0, 0, 1, 1},
    {&__pyx_n_s_HubServer_execute_db_query, __pyx_k_HubServer_execute_db_query, sizeof(__pyx_k_HubServer_execute_db_query), 0, 0, 1, 1},
    {&__pyx_n_s_HubServer_execute_db_query_local, __pyx_k_HubServer_execute_db_query_local, sizeof(__pyx_k_HubServer_execute_db_query_local), 0, 0, 1, 1},
    {&__pyx_n_s_HubServer_get_steps, __pyx_k_HubServer_get_steps, sizeof(__pyx_k_HubServer_get_steps), 0, 0, 1, 1},
    {&__pyx_n_s_HubServer_get_steps_locals_genex, __pyx_k_HubServer_get_steps_locals_genex, sizeof(__pyx_k_HubServer_get_steps_locals_genex), 0, 0, 1, 1},
    {&__pyx_n_s_HubServer_start, __pyx_k_HubServer_start, sizeof(__pyx_k_HubServer_start), 0, 0, 1, 1},
    {&__pyx_kp_s_INSERT_INTO_buelon_jobs_waiting, __pyx_k_INSERT_INTO_buelon_jobs_waiting, sizeof(__pyx_k_INSERT_INTO_buelon_jobs_waiting), 0, 0, 1, 0},
    {&__pyx_kp_s_INSERT_INTO_steps_id_priority_sc, __pyx_k_INSERT_INTO_steps_id_priority_sc, sizeof(__pyx_k_INSERT_INTO_steps_id_priority_sc), 0, 0, 1, 0},
    {&__pyx_n_s_IPPROTO_TCP, __pyx_k_IPPROTO_TCP, sizeof(__pyx_k_IPPROTO_TCP), 0, 0, 1, 1},
    {&__pyx_n_s_InsufficientPrivilege, __pyx_k_InsufficientPrivilege, sizeof(__pyx_k_InsufficientPrivilege), 0, 0, 1, 1},
    {&__pyx_kp_s_Insufficient_privileges_to_creat, __pyx_k_Insufficient_privileges_to_creat, sizeof(__pyx_k_Insufficient_privileges_to_creat), 0, 0, 1, 0},
    {&__pyx_kp_u_Invalid_method, __pyx_k_Invalid_method, sizeof(__pyx_k_Invalid_method), 0, 1, 0, 0},
    {&__pyx_kp_u_Invalid_value_received, __pyx_k_Invalid_value_received, sizeof(__pyx_k_Invalid_value_received), 0, 1, 0, 0},
    {&__pyx_kp_s_K, __pyx_k_K, sizeof(__pyx_k_K), 0, 0, 1, 0},
    {&__pyx_n_s_KeyboardInterrupt, __pyx_k_KeyboardInterrupt, sizeof(__pyx_k_KeyboardInterrupt), 0, 0, 1, 1},
    {&__pyx_n_s_LENGTH_OF_PIPELINE_END_TOKEN, __pyx_k_LENGTH_OF_PIPELINE_END_TOKEN, sizeof(__pyx_k_LENGTH_OF_PIPELINE_END_TOKEN), 0, 0, 1, 1},
    {&__pyx_kp_u_LIMIT, __pyx_k_LIMIT, sizeof(__pyx_k_LIMIT), 0, 1, 0, 0},
    {&__pyx_kp_u_LIMIT_2, __pyx_k_LIMIT_2, sizeof(__pyx_k_LIMIT_2), 0, 1, 0, 0},
    {&__pyx_kp_u_LIMIT_3, __pyx_k_LIMIT_3, sizeof(__pyx_k_LIMIT_3), 0, 1, 0, 0},
    {&__pyx_kp_u_LIMIT_4, __pyx_k_LIMIT_4, sizeof(__pyx_k_LIMIT_4), 0, 1, 0, 0},
    {&__pyx_kp_u_LIMIT_5, __pyx_k_LIMIT_5, sizeof(__pyx_k_LIMIT_5), 0, 1, 0, 0},
    {&__pyx_kp_u_LIMIT_OFFSET, __pyx_k_LIMIT_OFFSET, sizeof(__pyx_k_LIMIT_OFFSET), 0, 1, 0, 0},
    {&__pyx_n_s_Lock, __pyx_k_Lock, sizeof(__pyx_k_Lock), 0, 0, 1, 1},
    {&__pyx_kp_s_Max_errors_met, __pyx_k_Max_errors_met, sizeof(__pyx_k_Max_errors_met), 0, 0, 1, 0},
    {&__pyx_n_s_Method, __pyx_k_Method, sizeof(__pyx_k_Method), 0, 0, 1, 1},
    {&__pyx_n_s_ModuleNotFoundError, __pyx_k_ModuleNotFoundError, sizeof(__pyx_k_ModuleNotFoundError), 0, 0, 1, 1},
    {&__pyx_kp_u_No_data_found_for_step, __pyx_k_No_data_found_for_step, sizeof(__pyx_k_No_data_found_for_step), 0, 1, 0, 0},
    {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1},
    {&__pyx_kp_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 0},
    {&__pyx_kp_s_OR, __pyx_k_OR, sizeof(__pyx_k_OR), 0, 0, 1, 0},
    {&__pyx_kp_u_ORDER_BY, __pyx_k_ORDER_BY, sizeof(__pyx_k_ORDER_BY), 0, 1, 0, 0},
    {&__pyx_kp_u_ORDER_BY_2, __pyx_k_ORDER_BY_2, sizeof(__pyx_k_ORDER_BY_2), 0, 1, 0, 0},
    {&__pyx_kp_u_ORDER_BY_3, __pyx_k_ORDER_BY_3, sizeof(__pyx_k_ORDER_BY_3), 0, 1, 0, 0},
    {&__pyx_kp_u_ORDER_BY_4, __pyx_k_ORDER_BY_4, sizeof(__pyx_k_ORDER_BY_4), 0, 1, 0, 0},
    {&__pyx_kp_u_OR_epoch_coalesce_timeout, __pyx_k_OR_epoch_coalesce_timeout, sizeof(__pyx_k_OR_epoch_coalesce_timeout), 0, 1, 0, 0},
    {&__pyx_kp_u_OR_lower_trace_like, __pyx_k_OR_lower_trace_like, sizeof(__pyx_k_OR_lower_trace_like), 0, 1, 0, 0},
    {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1},
    {&__pyx_n_s_PENDING, __pyx_k_PENDING, sizeof(__pyx_k_PENDING), 0, 0, 1, 1},
    {&__pyx_n_s_PIPELINE_END_TOKEN, __pyx_k_PIPELINE_END_TOKEN, sizeof(__pyx_k_PIPELINE_END_TOKEN), 0, 0, 1, 1},
    {&__pyx_n_s_PIPELINE_HOST, __pyx_k_PIPELINE_HOST, sizeof(__pyx_k_PIPELINE_HOST), 0, 0, 1, 1},
    {&__pyx_n_s_PIPELINE_PORT, __pyx_k_PIPELINE_PORT, sizeof(__pyx_k_PIPELINE_PORT), 0, 0, 1, 1},
    {&__pyx_n_s_PIPELINE_SPLIT_TOKEN, __pyx_k_PIPELINE_SPLIT_TOKEN, sizeof(__pyx_k_PIPELINE_SPLIT_TOKEN), 0, 0, 1, 1},
    {&__pyx_n_s_PIPE_WORKER_HOST, __pyx_k_PIPE_WORKER_HOST, sizeof(__pyx_k_PIPE_WORKER_HOST), 0, 0, 1, 1},
    {&__pyx_n_s_PIPE_WORKER_PORT, __pyx_k_PIPE_WORKER_PORT, sizeof(__pyx_k_PIPE_WORKER_PORT), 0, 0, 1, 1},
    {&__pyx_kp_s_PRAGMA_journal_mode_WAL, __pyx_k_PRAGMA_journal_mode_WAL, sizeof(__pyx_k_PRAGMA_journal_mode_WAL), 0, 0, 1, 0},
    {&__pyx_kp_u_Port, __pyx_k_Port, sizeof(__pyx_k_Port), 0, 1, 0, 0},
    {&__pyx_n_s_Queue, __pyx_k_Queue, sizeof(__pyx_k_Queue), 0, 0, 1, 1},
    {&__pyx_n_s_RESET, __pyx_k_RESET, sizeof(__pyx_k_RESET), 0, 0, 1, 1},
    {&__pyx_n_s_RESET_ERRORS, __pyx_k_RESET_ERRORS, sizeof(__pyx_k_RESET_ERRORS), 0, 0, 1, 1},
    {&__pyx_kp_s_Repairing_Steps_Commits_every_1, __pyx_k_Repairing_Steps_Commits_every_1, sizeof(__pyx_k_Repairing_Steps_Commits_every_1), 0, 0, 1, 0},
    {&__pyx_kp_u_Request_timed_out_after, __pyx_k_Request_timed_out_after, sizeof(__pyx_k_Request_timed_out_after), 0, 1, 0, 0},
    {&__pyx_kp_u_SELECT_COUNT_FROM_buelon_jobs_WH, __pyx_k_SELECT_COUNT_FROM_buelon_jobs_WH, sizeof(__pyx_k_SELECT_COUNT_FROM_buelon_jobs_WH), 0, 1, 0, 0},
    {&__pyx_kp_u_SELECT_COUNT_FROM_steps_WHERE_st, __pyx_k_SELECT_COUNT_FROM_steps_WHERE_st, sizeof(__pyx_k_SELECT_COUNT_FROM_steps_WHERE_st), 0, 1, 0, 0},
    {&__pyx_kp_u_SELECT_FROM_buelon_jobs_WHERE_id, __pyx_k_SELECT_FROM_buelon_jobs_WHERE_id, sizeof(__pyx_k_SELECT_FROM_buelon_jobs_WHERE_id), 0, 1, 0, 0},
    {&__pyx_kp_u_SELECT_FROM_steps_WHERE_id, __pyx_k_SELECT_FROM_steps_WHERE_id, sizeof(__pyx_k_SELECT_FROM_steps_WHERE_id), 0, 1, 0, 0},
    {&__pyx_kp_u_SELECT_id_msg_trace_FROM_buelon, __pyx_k_SELECT_id_msg_trace_FROM_buelon, sizeof(__pyx_k_SELECT_id_msg_trace_FROM_buelon), 0, 1, 0, 0},
    {&__pyx_kp_u_SELECT_id_msg_trace_FROM_steps_W, __pyx_k_SELECT_id_msg_trace_FROM_steps_W, sizeof(__pyx_k_SELECT_id_msg_trace_FROM_steps_W), 0, 1, 0, 0},
    {&__pyx_kp_u_SELECT_id_priority_scope_velocit, __pyx_k_SELECT_id_priority_scope_velocit, sizeof(__pyx_k_SELECT_id_priority_scope_velocit), 0, 1, 0, 0},
    {&__pyx_kp_u_SELECT_s_id_s_id_s_priority_s_s, __pyx_k_SELECT_s_id_s_id_s_priority_s_s, sizeof(__pyx_k_SELECT_s_id_s_id_s_priority_s_s), 0, 1, 0, 0},
    {&__pyx_kp_u_SELECT_status_FROM_steps_WHERE_i, __pyx_k_SELECT_status_FROM_steps_WHERE_i, sizeof(__pyx_k_SELECT_status_FROM_steps_WHERE_i), 0, 1, 0, 0},
    {&__pyx_kp_s_SELECT_tag_velocity_FROM_tags, __pyx_k_SELECT_tag_velocity_FROM_tags, sizeof(__pyx_k_SELECT_tag_velocity_FROM_tags), 0, 0, 1, 0},
    {&__pyx_n_s_SHUT_RDWR, __pyx_k_SHUT_RDWR, sizeof(__pyx_k_SHUT_RDWR), 0, 0, 1, 1},
    {&__pyx_n_s_SIGALRM, __pyx_k_SIGALRM, sizeof(__pyx_k_SIGALRM), 0, 0, 1, 1},
    {&__pyx_n_s_SOCK_STREAM, __pyx_k_SOCK_STREAM, sizeof(__pyx_k_SOCK_STREAM), 0, 0, 1, 1},
    {&__pyx_n_s_SQLiteQueue, __pyx_k_SQLiteQueue, sizeof(__pyx_k_SQLiteQueue), 0, 0, 1, 1},
    {&__pyx_n_s_STEP_COUNT, __pyx_k_STEP_COUNT, sizeof(__pyx_k_STEP_COUNT), 0, 0, 1, 1},
    {&__pyx_kp_u_Server_listening_on, __pyx_k_Server_listening_on, sizeof(__pyx_k_Server_listening_on), 0, 1, 0, 0},
    {&__pyx_n_s_Step, __pyx_k_Step, sizeof(__pyx_k_Step), 0, 0, 1, 1},
    {&__pyx_n_s_StepStatus, __pyx_k_StepStatus, sizeof(__pyx_k_StepStatus), 0, 0, 1, 1},
    {&__pyx_kp_s_TAB_scope_scope_priority_priorit, __pyx_k_TAB_scope_scope_priority_priorit, sizeof(__pyx_k_TAB_scope_scope_priority_priorit), 0, 0, 1, 0},
    {&__pyx_n_s_TCP_NODELAY, __pyx_k_TCP_NODELAY, sizeof(__pyx_k_TCP_NODELAY), 0, 0, 1, 1},
    {&__pyx_n_s_Thread, __pyx_k_Thread, sizeof(__pyx_k_Thread), 0, 0, 1, 1},
    {&__pyx_n_s_ThreadPoolExecutor, __pyx_k_ThreadPoolExecutor, sizeof(__pyx_k_ThreadPoolExecutor), 0, 0, 1, 1},
    {&__pyx_n_s_ThreadSafeSQLiteQueue, __pyx_k_ThreadSafeSQLiteQueue, sizeof(__pyx_k_ThreadSafeSQLiteQueue), 0, 0, 1, 1},
    {&__pyx_n_s_ThreadSafeSQLiteQueue___init, __pyx_k_ThreadSafeSQLiteQueue___init, sizeof(__pyx_k_ThreadSafeSQLiteQueue___init), 0, 0, 1, 1},
    {&__pyx_n_s_ThreadSafeSQLiteQueue__get_queue, __pyx_k_ThreadSafeSQLiteQueue__get_queue, sizeof(__pyx_k_ThreadSafeSQLiteQueue__get_queue), 0, 0, 1, 1},
    {&__pyx_n_s_ThreadSafeSQLiteQueue_get, __pyx_k_ThreadSafeSQLiteQueue_get, sizeof(__pyx_k_ThreadSafeSQLiteQueue_get), 0, 0, 1, 1},
    {&__pyx_n_s_ThreadSafeSQLiteQueue_put, __pyx_k_ThreadSafeSQLiteQueue_put, sizeof(__pyx_k_ThreadSafeSQLiteQueue_put), 0, 0, 1, 1},
    {&__pyx_n_s_ThreadSafeSQLiteQueue_qsize, __pyx_k_ThreadSafeSQLiteQueue_qsize, sizeof(__pyx_k_ThreadSafeSQLiteQueue_qsize), 0, 0, 1, 1},
    {&__pyx_n_s_ThreadSafeSQLiteQueue_task_done, __pyx_k_ThreadSafeSQLiteQueue_task_done, sizeof(__pyx_k_ThreadSafeSQLiteQueue_task_done), 0, 0, 1, 1},
    {&__pyx_n_s_TimeoutError, __pyx_k_TimeoutError, sizeof(__pyx_k_TimeoutError), 0, 0, 1, 1},
    {&__pyx_kp_u_UPDATE_buelon_jobs_SET_status, __pyx_k_UPDATE_buelon_jobs_SET_status, sizeof(__pyx_k_UPDATE_buelon_jobs_SET_status), 0, 1, 0, 0},
    {&__pyx_kp_u_UPDATE_buelon_jobs_s_SET_state, __pyx_k_UPDATE_buelon_jobs_s_SET_state, sizeof(__pyx_k_UPDATE_buelon_jobs_s_SET_state), 0, 1, 0, 0},
    {&__pyx_kp_u_UPDATE_steps_SET_status, __pyx_k_UPDATE_steps_SET_status, sizeof(__pyx_k_UPDATE_steps_SET_status), 0, 1, 0, 0},
    {&__pyx_kp_u_UPDATE_steps_SET_status_epoch_W, __pyx_k_UPDATE_steps_SET_status_epoch_W, sizeof(__pyx_k_UPDATE_steps_SET_status_epoch_W), 0, 1, 0, 0},
    {&__pyx_n_s_UPLOAD_STEP, __pyx_k_UPLOAD_STEP, sizeof(__pyx_k_UPLOAD_STEP), 0, 0, 1, 1},
    {&__pyx_n_s_UPLOAD_STEPS, __pyx_k_UPLOAD_STEPS, sizeof(__pyx_k_UPLOAD_STEPS), 0, 0, 1, 1},
    {&__pyx_n_s_USING_POSTGRES, __pyx_k_USING_POSTGRES, sizeof(__pyx_k_USING_POSTGRES), 0, 0, 1, 1},
    {&__pyx_n_s_USING_POSTGRES_HUB, __pyx_k_USING_POSTGRES_HUB, sizeof(__pyx_k_USING_POSTGRES_HUB), 0, 0, 1, 1},
    {&__pyx_kp_s_Uploading_Jobs, __pyx_k_Uploading_Jobs, sizeof(__pyx_k_Uploading_Jobs), 0, 0, 1, 0},
    {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
    {&__pyx_kp_u_WHEN_THEN, __pyx_k_WHEN_THEN, sizeof(__pyx_k_WHEN_THEN), 0, 1, 0, 0},
    {&__pyx_kp_u_WHERE_id_IN, __pyx_k_WHERE_id_IN, sizeof(__pyx_k_WHERE_id_IN), 0, 1, 0, 0},
    {&__pyx_kp_u_WHERE_s_id_IN_SELECT_s_id_FROM, __pyx_k_WHERE_s_id_IN_SELECT_s_id_FROM, sizeof(__pyx_k_WHERE_s_id_IN_SELECT_s_id_FROM), 0, 1, 0, 0},
    {&__pyx_kp_u_WITH_updated_jobs_AS_UPDATE_bue, __pyx_k_WITH_updated_jobs_AS_UPDATE_bue, sizeof(__pyx_k_WITH_updated_jobs_AS_UPDATE_bue), 0, 1, 0, 0},
    {&__pyx_n_s_WORKER_HOST, __pyx_k_WORKER_HOST, sizeof(__pyx_k_WORKER_HOST), 0, 0, 1, 1},
    {&__pyx_n_s_WORKER_PORT, __pyx_k_WORKER_PORT, sizeof(__pyx_k_WORKER_PORT), 0, 0, 1, 1},
    {&__pyx_n_s_Windows, __pyx_k_Windows, sizeof(__pyx_k_Windows), 0, 0, 1, 1},
    {&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0},
    {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0},
    {&__pyx_kp_s__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 1, 0},
    {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0},
    {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0},
    {&__pyx_kp_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 0},
    {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0},
    {&__pyx_kp_s__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 1, 0},
    {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0},
    {&__pyx_kp_s__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 0},
    {&__pyx_kp_s__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 1, 0},
    {&__pyx_kp_s__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 0, 1, 0},
    {&__pyx_kp_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 0},
    {&__pyx_kp_u__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0, 0},
    {&__pyx_kp_u__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 1, 0, 0},
    {&__pyx_kp_b__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 0, 0},
    {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0},
    {&__pyx_kp_u__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 1, 0, 0},
    {&__pyx_kp_u__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 1, 0, 0},
    {&__pyx_kp_s__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 1, 0},
    {&__pyx_kp_s__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 1, 0},
    {&__pyx_kp_u__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 1, 0, 0},
    {&__pyx_kp_u__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 1, 0, 0},
    {&__pyx_kp_u__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 1, 0, 0},
    {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
    {&__pyx_kp_u__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 1, 0, 0},
    {&__pyx_kp_u__44, __pyx_k__44, sizeof(__pyx_k__44), 0, 1, 0, 0},
    {&__pyx_kp_u__45, __pyx_k__45, sizeof(__pyx_k__45), 0, 1, 0, 0},
    {&__pyx_kp_u__48, __pyx_k__48, sizeof(__pyx_k__48), 0, 1, 0, 0},
    {&__pyx_kp_u__49, __pyx_k__49, sizeof(__pyx_k__49), 0, 1, 0, 0},
    {&__pyx_kp_u__50, __pyx_k__50, sizeof(__pyx_k__50), 0, 1, 0, 0},
    {&__pyx_kp_b__68, __pyx_k__68, sizeof(__pyx_k__68), 0, 0, 0, 0},
    {&__pyx_kp_b__69, __pyx_k__69, sizeof(__pyx_k__69), 0, 0, 0, 0},
    {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0},
    {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0},
    {&__pyx_kp_s_abcdefghijklmnopqrstuvwxyzABCDE, __pyx_k_abcdefghijklmnopqrstuvwxyzABCDE, sizeof(__pyx_k_abcdefghijklmnopqrstuvwxyzABCDE), 0, 0, 1, 0},
    {&__pyx_n_s_accept, __pyx_k_accept, sizeof(__pyx_k_accept), 0, 0, 1, 1},
    {&__pyx_n_s_active, __pyx_k_active, sizeof(__pyx_k_active), 0, 0, 1, 1},
    {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
    {&__pyx_n_s_addr, __pyx_k_addr, sizeof(__pyx_k_addr), 0, 0, 1, 1},
    {&__pyx_n_s_alarm, __pyx_k_alarm, sizeof(__pyx_k_alarm), 0, 0, 1, 1},
    {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
    {&__pyx_n_s_allow_chars, __pyx_k_allow_chars, sizeof(__pyx_k_allow_chars), 0, 0, 1, 1},
    {&__pyx_n_s_already, __pyx_k_already, sizeof(__pyx_k_already), 0, 0, 1, 1},
    {&__pyx_n_s_already_2, __pyx_k_already_2, sizeof(__pyx_k_already_2), 0, 0, 1, 1},
    {&__pyx_n_s_amount, __pyx_k_amount, sizeof(__pyx_k_amount), 0, 0, 1, 1},
    {&__pyx_kp_u_and_status, __pyx_k_and_status, sizeof(__pyx_k_and_status), 0, 1, 0, 0},
    {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
    {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
    {&__pyx_n_s_asyncio, __pyx_k_asyncio, sizeof(__pyx_k_asyncio), 0, 0, 1, 1},
    {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
    {&__pyx_n_s_asyncio_tasks, __pyx_k_asyncio_tasks, sizeof(__pyx_k_asyncio_tasks), 0, 0, 1, 1},
    {&__pyx_n_s_attempt, __pyx_k_attempt, sizeof(__pyx_k_attempt), 0, 0, 1, 1},
    {&__pyx_n_s_attempts, __pyx_k_attempts, sizeof(__pyx_k_attempts), 0, 0, 1, 1},
    {&__pyx_n_s_auto_commit, __pyx_k_auto_commit, sizeof(__pyx_k_auto_commit), 0, 0, 1, 1},
    {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
    {&__pyx_n_s_bind, __pyx_k_bind, sizeof(__pyx_k_bind), 0, 0, 1, 1},
    {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
    {&__pyx_n_s_bucket, __pyx_k_bucket, sizeof(__pyx_k_bucket), 0, 0, 1, 1},
    {&__pyx_n_s_bucket_client, __pyx_k_bucket_client, sizeof(__pyx_k_bucket_client), 0, 0, 1, 1},
    {&__pyx_n_s_buelon, __pyx_k_buelon, sizeof(__pyx_k_buelon), 0, 0, 1, 1},
    {&__pyx_n_s_buelon_bucket, __pyx_k_buelon_bucket, sizeof(__pyx_k_buelon_bucket), 0, 0, 1, 1},
    {&__pyx_n_s_buelon_core_pipe_debug, __pyx_k_buelon_core_pipe_debug, sizeof(__pyx_k_buelon_core_pipe_debug), 0, 0, 1, 1},
    {&__pyx_n_s_buelon_core_pipe_interpreter, __pyx_k_buelon_core_pipe_interpreter, sizeof(__pyx_k_buelon_core_pipe_interpreter), 0, 0, 1, 1},
    {&__pyx_n_s_buelon_core_step, __pyx_k_buelon_core_step, sizeof(__pyx_k_buelon_core_step), 0, 0, 1, 1},
    {&__pyx_kp_s_buelon_core_step_Step, __pyx_k_buelon_core_step_Step, sizeof(__pyx_k_buelon_core_step_Step), 0, 0, 1, 0},
    {&__pyx_kp_s_buelon_core_step_StepStatus, __pyx_k_buelon_core_step_StepStatus, sizeof(__pyx_k_buelon_core_step_StepStatus), 0, 0, 1, 0},
    {&__pyx_kp_s_buelon_core_step_Step_None, __pyx_k_buelon_core_step_Step_None, sizeof(__pyx_k_buelon_core_step_Step_None), 0, 0, 1, 0},
    {&__pyx_n_s_buelon_cython_c_hub, __pyx_k_buelon_cython_c_hub, sizeof(__pyx_k_buelon_cython_c_hub), 0, 0, 1, 1},
    {&__pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_k_buelon_cython_c_hub_pyx, sizeof(__pyx_k_buelon_cython_c_hub_pyx), 0, 0, 1, 0},
    {&__pyx_n_s_buelon_helpers_json_parser, __pyx_k_buelon_helpers_json_parser, sizeof(__pyx_k_buelon_helpers_json_parser), 0, 0, 1, 1},
    {&__pyx_n_s_buelon_helpers_lazy_load_class, __pyx_k_buelon_helpers_lazy_load_class, sizeof(__pyx_k_buelon_helpers_lazy_load_class), 0, 0, 1, 1},
    {&__pyx_n_s_buelon_status_map, __pyx_k_buelon_status_map, sizeof(__pyx_k_buelon_status_map), 0, 0, 1, 1},
    {&__pyx_kp_u_buj_left_join_buelon_status_map, __pyx_k_buj_left_join_buelon_status_map, sizeof(__pyx_k_buj_left_join_buelon_status_map), 0, 1, 0, 0},
    {&__pyx_n_s_bulk, __pyx_k_bulk, sizeof(__pyx_k_bulk), 0, 0, 1, 1},
    {&__pyx_n_s_bulk_get, __pyx_k_bulk_get, sizeof(__pyx_k_bulk_get), 0, 0, 1, 1},
    {&__pyx_n_s_bulk_get_data, __pyx_k_bulk_get_data, sizeof(__pyx_k_bulk_get_data), 0, 0, 1, 1},
    {&__pyx_n_s_bulk_get_step, __pyx_k_bulk_get_step, sizeof(__pyx_k_bulk_get_step), 0, 0, 1, 1},
    {&__pyx_n_s_bulk_set, __pyx_k_bulk_set, sizeof(__pyx_k_bulk_set), 0, 0, 1, 1},
    {&__pyx_n_s_bulk_set_data, __pyx_k_bulk_set_data, sizeof(__pyx_k_bulk_set_data), 0, 0, 1, 1},
    {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1},
    {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
    {&__pyx_kp_s_callable_None, __pyx_k_callable_None, sizeof(__pyx_k_callable_None), 0, 0, 1, 0},
    {&__pyx_n_s_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1},
    {&__pyx_n_s_cancel_2, __pyx_k_cancel_2, sizeof(__pyx_k_cancel_2), 0, 0, 1, 1},
    {&__pyx_n_s_cancels, __pyx_k_cancels, sizeof(__pyx_k_cancels), 0, 0, 1, 1},
    {&__pyx_n_s_case_statement, __pyx_k_case_statement, sizeof(__pyx_k_case_statement), 0, 0, 1, 1},
    {&__pyx_n_s_check_active_state, __pyx_k_check_active_state, sizeof(__pyx_k_check_active_state), 0, 0, 1, 1},
    {&__pyx_n_s_check_to_delete_bucket_files, __pyx_k_check_to_delete_bucket_files, sizeof(__pyx_k_check_to_delete_bucket_files), 0, 0, 1, 1},
    {&__pyx_n_s_check_to_delete_bucket_files_2, __pyx_k_check_to_delete_bucket_files_2, sizeof(__pyx_k_check_to_delete_bucket_files_2), 0, 0, 1, 1},
    {&__pyx_n_s_child, __pyx_k_child, sizeof(__pyx_k_child), 0, 0, 1, 1},
    {&__pyx_n_s_children, __pyx_k_children, sizeof(__pyx_k_children), 0, 0, 1, 1},
    {&__pyx_n_s_children_params, __pyx_k_children_params, sizeof(__pyx_k_children_params), 0, 0, 1, 1},
    {&__pyx_n_s_chunk, __pyx_k_chunk, sizeof(__pyx_k_chunk), 0, 0, 1, 1},
    {&__pyx_n_s_chunk_size, __pyx_k_chunk_size, sizeof(__pyx_k_chunk_size), 0, 0, 1, 1},
    {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
    {&__pyx_n_s_clean_query_string, __pyx_k_clean_query_string, sizeof(__pyx_k_clean_query_string), 0, 0, 1, 1},
    {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
    {&__pyx_n_s_client, __pyx_k_client, sizeof(__pyx_k_client), 0, 0, 1, 1},
    {&__pyx_n_s_client_socket, __pyx_k_client_socket, sizeof(__pyx_k_client_socket), 0, 0, 1, 1},
    {&__pyx_n_s_client_thread, __pyx_k_client_thread, sizeof(__pyx_k_client_thread), 0, 0, 1, 1},
    {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
    {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
    {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1},
    {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
    {&__pyx_n_s_commit, __pyx_k_commit, sizeof(__pyx_k_commit), 0, 0, 1, 1},
    {&__pyx_n_s_concurrent_futures, __pyx_k_concurrent_futures, sizeof(__pyx_k_concurrent_futures), 0, 0, 1, 1},
    {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 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_queue, __pyx_k_connection_queue, sizeof(__pyx_k_connection_queue), 0, 0, 1, 1},
    {&__pyx_n_s_core, __pyx_k_core, sizeof(__pyx_k_core), 0, 0, 1, 1},
    {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
    {&__pyx_kp_s_count_must_be_an_integer, __pyx_k_count_must_be_an_integer, sizeof(__pyx_k_count_must_be_an_integer), 0, 0, 1, 0},
    {&__pyx_n_s_create_db_pool, __pyx_k_create_db_pool, sizeof(__pyx_k_create_db_pool), 0, 0, 1, 1},
    {&__pyx_kp_s_create_index_if_not_exists_idx_b, __pyx_k_create_index_if_not_exists_idx_b, sizeof(__pyx_k_create_index_if_not_exists_idx_b), 0, 0, 1, 0},
    {&__pyx_kp_s_create_index_if_not_exists_idx_b_2, __pyx_k_create_index_if_not_exists_idx_b_2, sizeof(__pyx_k_create_index_if_not_exists_idx_b_2), 0, 0, 1, 0},
    {&__pyx_kp_s_create_index_if_not_exists_idx_b_3, __pyx_k_create_index_if_not_exists_idx_b_3, sizeof(__pyx_k_create_index_if_not_exists_idx_b_3), 0, 0, 1, 0},
    {&__pyx_kp_s_create_index_if_not_exists_idx_b_4, __pyx_k_create_index_if_not_exists_idx_b_4, sizeof(__pyx_k_create_index_if_not_exists_idx_b_4), 0, 0, 1, 0},
    {&__pyx_kp_s_create_table_bue_session_ids_id, __pyx_k_create_table_bue_session_ids_id, sizeof(__pyx_k_create_table_bue_session_ids_id), 0, 0, 1, 0},
    {&__pyx_kp_s_create_table_if_not_exists_buelo, __pyx_k_create_table_if_not_exists_buelo, sizeof(__pyx_k_create_table_if_not_exists_buelo), 0, 0, 1, 0},
    {&__pyx_n_s_cur, __pyx_k_cur, sizeof(__pyx_k_cur), 0, 0, 1, 1},
    {&__pyx_n_s_cursor, __pyx_k_cursor, sizeof(__pyx_k_cursor), 0, 0, 1, 1},
    {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
    {&__pyx_n_s_daemon, __pyx_k_daemon, sizeof(__pyx_k_daemon), 0, 0, 1, 1},
    {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
    {&__pyx_kp_s_database_db, __pyx_k_database_db, sizeof(__pyx_k_database_db), 0, 0, 1, 0},
    {&__pyx_n_s_db, __pyx_k_db, sizeof(__pyx_k_db), 0, 0, 1, 1},
    {&__pyx_n_s_db_operation, __pyx_k_db_operation, sizeof(__pyx_k_db_operation), 0, 0, 1, 1},
    {&__pyx_n_s_db_path, __pyx_k_db_path, sizeof(__pyx_k_db_path), 0, 0, 1, 1},
    {&__pyx_n_s_db_pool, __pyx_k_db_pool, sizeof(__pyx_k_db_pool), 0, 0, 1, 1},
    {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
    {&__pyx_n_s_decrement_tag_usage, __pyx_k_decrement_tag_usage, sizeof(__pyx_k_decrement_tag_usage), 0, 0, 1, 1},
    {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
    {&__pyx_n_s_defaultdict, __pyx_k_defaultdict, sizeof(__pyx_k_defaultdict), 0, 0, 1, 1},
    {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1},
    {&__pyx_kp_u_delete_from_bue_session_ids_wher, __pyx_k_delete_from_bue_session_ids_wher, sizeof(__pyx_k_delete_from_bue_session_ids_wher), 0, 1, 0, 0},
    {&__pyx_kp_s_delete_from_buelon_jobs, __pyx_k_delete_from_buelon_jobs, sizeof(__pyx_k_delete_from_buelon_jobs), 0, 0, 1, 0},
    {&__pyx_kp_s_delete_from_steps, __pyx_k_delete_from_steps, sizeof(__pyx_k_delete_from_steps), 0, 0, 1, 0},
    {&__pyx_n_s_delete_last_line, __pyx_k_delete_last_line, sizeof(__pyx_k_delete_last_line), 0, 0, 1, 1},
    {&__pyx_kp_b_delete_steps, __pyx_k_delete_steps, sizeof(__pyx_k_delete_steps), 0, 0, 0, 0},
    {&__pyx_kp_s_delete_steps, __pyx_k_delete_steps, sizeof(__pyx_k_delete_steps), 0, 0, 1, 0},
    {&__pyx_n_s_delete_steps_2, __pyx_k_delete_steps_2, sizeof(__pyx_k_delete_steps_2), 0, 0, 1, 1},
    {&__pyx_n_s_delete_steps_3, __pyx_k_delete_steps_3, sizeof(__pyx_k_delete_steps_3), 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_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
    {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
    {&__pyx_kp_s_dict_str_Any, __pyx_k_dict_str_Any, sizeof(__pyx_k_dict_str_Any), 0, 0, 1, 0},
    {&__pyx_kp_s_dict_str_buelon_core_step_Step_N, __pyx_k_dict_str_buelon_core_step_Step_N, sizeof(__pyx_k_dict_str_buelon_core_step_Step_N), 0, 0, 1, 0},
    {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
    {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
    {&__pyx_n_s_done, __pyx_k_done, sizeof(__pyx_k_done), 0, 0, 1, 1},
    {&__pyx_n_s_done_2, __pyx_k_done_2, sizeof(__pyx_k_done_2), 0, 0, 1, 1},
    {&__pyx_n_s_dones, __pyx_k_dones, sizeof(__pyx_k_dones), 0, 0, 1, 1},
    {&__pyx_n_s_dotenv, __pyx_k_dotenv, sizeof(__pyx_k_dotenv), 0, 0, 1, 1},
    {&__pyx_n_s_download_table, __pyx_k_download_table, sizeof(__pyx_k_download_table), 0, 0, 1, 1},
    {&__pyx_kp_s_drop_table_bue_session_ids, __pyx_k_drop_table_bue_session_ids, sizeof(__pyx_k_drop_table_bue_session_ids), 0, 0, 1, 0},
    {&__pyx_kp_s_drop_table_if_exists_bue_session, __pyx_k_drop_table_if_exists_bue_session, sizeof(__pyx_k_drop_table_if_exists_bue_session), 0, 0, 1, 0},
    {&__pyx_n_s_dumps, __pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 0, 1, 1},
    {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
    {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
    {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
    {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
    {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1},
    {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
    {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1},
    {&__pyx_kp_s_env, __pyx_k_env, sizeof(__pyx_k_env), 0, 0, 1, 0},
    {&__pyx_n_s_environ, __pyx_k_environ, sizeof(__pyx_k_environ), 0, 0, 1, 1},
    {&__pyx_kp_u_epoch, __pyx_k_epoch, sizeof(__pyx_k_epoch), 0, 1, 0, 0},
    {&__pyx_kp_u_epoch_WHERE_id, __pyx_k_epoch_WHERE_id, sizeof(__pyx_k_epoch_WHERE_id), 0, 1, 0, 0},
    {&__pyx_kp_u_epoch_WHERE_id_IN, __pyx_k_epoch_WHERE_id_IN, sizeof(__pyx_k_epoch_WHERE_id_IN), 0, 1, 0, 0},
    {&__pyx_kp_u_epoch_msg_trace_WHERE_id, __pyx_k_epoch_msg_trace_WHERE_id, sizeof(__pyx_k_epoch_msg_trace_WHERE_id), 0, 1, 0, 0},
    {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
    {&__pyx_n_s_error_2, __pyx_k_error_2, sizeof(__pyx_k_error_2), 0, 0, 1, 1},
    {&__pyx_kp_u_error_3, __pyx_k_error_3, sizeof(__pyx_k_error_3), 0, 1, 0, 0},
    {&__pyx_n_s_error_size, __pyx_k_error_size, sizeof(__pyx_k_error_size), 0, 0, 1, 1},
    {&__pyx_n_s_error_size_query, __pyx_k_error_size_query, sizeof(__pyx_k_error_size_query), 0, 0, 1, 1},
    {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1},
    {&__pyx_n_s_exc, __pyx_k_exc, sizeof(__pyx_k_exc), 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_exclude, __pyx_k_exclude, sizeof(__pyx_k_exclude), 0, 0, 1, 1},
    {&__pyx_kp_s_exclude_must_be_a_list_of_string, __pyx_k_exclude_must_be_a_list_of_string, sizeof(__pyx_k_exclude_must_be_a_list_of_string), 0, 0, 1, 0},
    {&__pyx_kp_s_exclude_must_be_a_string_or_a_li, __pyx_k_exclude_must_be_a_string_or_a_li, sizeof(__pyx_k_exclude_must_be_a_string_or_a_li), 0, 0, 1, 0},
    {&__pyx_n_s_exclude_query, __pyx_k_exclude_query, sizeof(__pyx_k_exclude_query), 0, 0, 1, 1},
    {&__pyx_n_s_execute, __pyx_k_execute, sizeof(__pyx_k_execute), 0, 0, 1, 1},
    {&__pyx_n_s_execute_batch, __pyx_k_execute_batch, sizeof(__pyx_k_execute_batch), 0, 0, 1, 1},
    {&__pyx_n_s_execute_db_query, __pyx_k_execute_db_query, sizeof(__pyx_k_execute_db_query), 0, 0, 1, 1},
    {&__pyx_n_s_execute_request, __pyx_k_execute_request, sizeof(__pyx_k_execute_request), 0, 0, 1, 1},
    {&__pyx_n_s_execute_transaction, __pyx_k_execute_transaction, sizeof(__pyx_k_execute_transaction), 0, 0, 1, 1},
    {&__pyx_n_s_executing, __pyx_k_executing, sizeof(__pyx_k_executing), 0, 0, 1, 1},
    {&__pyx_n_s_execution_queue, __pyx_k_execution_queue, sizeof(__pyx_k_execution_queue), 0, 0, 1, 1},
    {&__pyx_n_s_executor_thread, __pyx_k_executor_thread, sizeof(__pyx_k_executor_thread), 0, 0, 1, 1},
    {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
    {&__pyx_n_s_exit_2, __pyx_k_exit_2, sizeof(__pyx_k_exit_2), 0, 0, 1, 1},
    {&__pyx_n_s_expiration_time, __pyx_k_expiration_time, sizeof(__pyx_k_expiration_time), 0, 0, 1, 1},
    {&__pyx_n_s_extras, __pyx_k_extras, sizeof(__pyx_k_extras), 0, 0, 1, 1},
    {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
    {&__pyx_n_s_fail, __pyx_k_fail, sizeof(__pyx_k_fail), 0, 0, 1, 1},
    {&__pyx_n_b_false, __pyx_k_false, sizeof(__pyx_k_false), 0, 0, 0, 1},
    {&__pyx_n_s_false, __pyx_k_false, sizeof(__pyx_k_false), 0, 0, 1, 1},
    {&__pyx_n_s_fetch_errors, __pyx_k_fetch_errors, sizeof(__pyx_k_fetch_errors), 0, 0, 1, 1},
    {&__pyx_kp_s_fetch_errors_2, __pyx_k_fetch_errors_2, sizeof(__pyx_k_fetch_errors_2), 0, 0, 1, 0},
    {&__pyx_n_s_fetch_errors_3, __pyx_k_fetch_errors_3, sizeof(__pyx_k_fetch_errors_3), 0, 0, 1, 1},
    {&__pyx_n_s_fetch_errors_locals_clean_query, __pyx_k_fetch_errors_locals_clean_query, sizeof(__pyx_k_fetch_errors_locals_clean_query), 0, 0, 1, 1},
    {&__pyx_n_s_fetch_errors_locals_clean_query_2, __pyx_k_fetch_errors_locals_clean_query_2, sizeof(__pyx_k_fetch_errors_locals_clean_query_2), 0, 0, 1, 1},
    {&__pyx_n_s_fetch_errors_locals_genexpr, __pyx_k_fetch_errors_locals_genexpr, sizeof(__pyx_k_fetch_errors_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_kp_s_fetch_rows, __pyx_k_fetch_rows, sizeof(__pyx_k_fetch_rows), 0, 0, 1, 0},
    {&__pyx_n_s_fetchall, __pyx_k_fetchall, sizeof(__pyx_k_fetchall), 0, 0, 1, 1},
    {&__pyx_n_s_file_path, __pyx_k_file_path, sizeof(__pyx_k_file_path), 0, 0, 1, 1},
    {&__pyx_n_s_finished_statuses, __pyx_k_finished_statuses, sizeof(__pyx_k_finished_statuses), 0, 0, 1, 1},
    {&__pyx_n_s_first_iteration, __pyx_k_first_iteration, sizeof(__pyx_k_first_iteration), 0, 0, 1, 1},
    {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
    {&__pyx_n_s_frame, __pyx_k_frame, sizeof(__pyx_k_frame), 0, 0, 1, 1},
    {&__pyx_n_s_from_json, __pyx_k_from_json, sizeof(__pyx_k_from_json), 0, 0, 1, 1},
    {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
    {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
    {&__pyx_n_s_generate_steps_from_code, __pyx_k_generate_steps_from_code, sizeof(__pyx_k_generate_steps_from_code), 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_data, __pyx_k_get_data, sizeof(__pyx_k_get_data), 0, 0, 1, 1},
    {&__pyx_n_s_get_job_statuses, __pyx_k_get_job_statuses, sizeof(__pyx_k_get_job_statuses), 0, 0, 1, 1},
    {&__pyx_n_s_get_job_statuses_locals_genexpr, __pyx_k_get_job_statuses_locals_genexpr, sizeof(__pyx_k_get_job_statuses_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_get_postgres_from_env, __pyx_k_get_postgres_from_env, sizeof(__pyx_k_get_postgres_from_env), 0, 0, 1, 1},
    {&__pyx_n_s_get_queue, __pyx_k_get_queue, sizeof(__pyx_k_get_queue), 0, 0, 1, 1},
    {&__pyx_n_s_get_rows, __pyx_k_get_rows, sizeof(__pyx_k_get_rows), 0, 0, 1, 1},
    {&__pyx_n_s_get_statuses, __pyx_k_get_statuses, sizeof(__pyx_k_get_statuses), 0, 0, 1, 1},
    {&__pyx_n_s_get_step, __pyx_k_get_step, sizeof(__pyx_k_get_step), 0, 0, 1, 1},
    {&__pyx_n_s_get_step_count, __pyx_k_get_step_count, sizeof(__pyx_k_get_step_count), 0, 0, 1, 1},
    {&__pyx_n_s_get_step_count_2, __pyx_k_get_step_count_2, sizeof(__pyx_k_get_step_count_2), 0, 0, 1, 1},
    {&__pyx_n_s_get_step_status, __pyx_k_get_step_status, sizeof(__pyx_k_get_step_status), 0, 0, 1, 1},
    {&__pyx_n_s_get_steps, __pyx_k_get_steps, sizeof(__pyx_k_get_steps), 0, 0, 1, 1},
    {&__pyx_kp_s_get_steps_2, __pyx_k_get_steps_2, sizeof(__pyx_k_get_steps_2), 0, 0, 1, 0},
    {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1},
    {&__pyx_kp_u_group_by_status, __pyx_k_group_by_status, sizeof(__pyx_k_group_by_status), 0, 1, 0, 0},
    {&__pyx_kp_u_group_by_status_2, __pyx_k_group_by_status_2, sizeof(__pyx_k_group_by_status_2), 0, 1, 0, 0},
    {&__pyx_n_s_handle_client, __pyx_k_handle_client, sizeof(__pyx_k_handle_client), 0, 0, 1, 1},
    {&__pyx_n_s_handler, __pyx_k_handler, sizeof(__pyx_k_handler), 0, 0, 1, 1},
    {&__pyx_n_s_headers, __pyx_k_headers, sizeof(__pyx_k_headers), 0, 0, 1, 1},
    {&__pyx_n_s_helpers, __pyx_k_helpers, sizeof(__pyx_k_helpers), 0, 0, 1, 1},
    {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1},
    {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1},
    {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
    {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
    {&__pyx_kp_u_id_2, __pyx_k_id_2, sizeof(__pyx_k_id_2), 0, 1, 0, 0},
    {&__pyx_kp_u_id_IN, __pyx_k_id_IN, sizeof(__pyx_k_id_IN), 0, 1, 0, 0},
    {&__pyx_n_s_id_column, __pyx_k_id_column, sizeof(__pyx_k_id_column), 0, 0, 1, 1},
    {&__pyx_kp_s_id_in, __pyx_k_id_in, sizeof(__pyx_k_id_in), 0, 0, 1, 0},
    {&__pyx_n_s_ids, __pyx_k_ids, sizeof(__pyx_k_ids), 0, 0, 1, 1},
    {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
    {&__pyx_n_s_include_workers, __pyx_k_include_workers, sizeof(__pyx_k_include_workers), 0, 0, 1, 1},
    {&__pyx_n_s_include_working, __pyx_k_include_working, sizeof(__pyx_k_include_working), 0, 0, 1, 1},
    {&__pyx_n_s_increments, __pyx_k_increments, sizeof(__pyx_k_increments), 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_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1},
    {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
    {&__pyx_kp_u_insert_into_bue_session_ids_id_a, __pyx_k_insert_into_bue_session_ids_id_a, sizeof(__pyx_k_insert_into_bue_session_ids_id_a), 0, 1, 0, 0},
    {&__pyx_n_s_inspect, __pyx_k_inspect, sizeof(__pyx_k_inspect), 0, 0, 1, 1},
    {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
    {&__pyx_kp_s_int_float, __pyx_k_int_float, sizeof(__pyx_k_int_float), 0, 0, 1, 0},
    {&__pyx_kp_s_int_float_Callable, __pyx_k_int_float_Callable, sizeof(__pyx_k_int_float_Callable), 0, 0, 1, 0},
    {&__pyx_kp_u_is_already_in_use_Retrying, __pyx_k_is_already_in_use_Retrying, sizeof(__pyx_k_is_already_in_use_Retrying), 0, 1, 0, 0},
    {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
    {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
    {&__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_job, __pyx_k_job, sizeof(__pyx_k_job), 0, 0, 1, 1},
    {&__pyx_n_s_job_handler, __pyx_k_job_handler, sizeof(__pyx_k_job_handler), 0, 0, 1, 1},
    {&__pyx_n_s_job_ids, __pyx_k_job_ids, sizeof(__pyx_k_job_ids), 0, 0, 1, 1},
    {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
    {&__pyx_n_s_json_parser, __pyx_k_json_parser, sizeof(__pyx_k_json_parser), 0, 0, 1, 1},
    {&__pyx_n_s_json_table, __pyx_k_json_table, sizeof(__pyx_k_json_table), 0, 0, 1, 1},
    {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
    {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
    {&__pyx_n_s_key_map, __pyx_k_key_map, sizeof(__pyx_k_key_map), 0, 0, 1, 1},
    {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
    {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
    {&__pyx_n_s_lazy_load_class, __pyx_k_lazy_load_class, sizeof(__pyx_k_lazy_load_class), 0, 0, 1, 1},
    {&__pyx_n_s_lazy_steps, __pyx_k_lazy_steps, sizeof(__pyx_k_lazy_steps), 0, 0, 1, 1},
    {&__pyx_n_s_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 0, 1, 1},
    {&__pyx_n_s_list, __pyx_k_list, sizeof(__pyx_k_list), 0, 0, 1, 1},
    {&__pyx_kp_s_list_None, __pyx_k_list_None, sizeof(__pyx_k_list_None), 0, 0, 1, 0},
    {&__pyx_kp_s_list_buelon_core_step_Step, __pyx_k_list_buelon_core_step_Step, sizeof(__pyx_k_list_buelon_core_step_Step), 0, 0, 1, 0},
    {&__pyx_kp_s_list_dict, __pyx_k_list_dict, sizeof(__pyx_k_list_dict), 0, 0, 1, 0},
    {&__pyx_kp_s_list_str, __pyx_k_list_str, sizeof(__pyx_k_list_str), 0, 0, 1, 0},
    {&__pyx_kp_s_list_str_str_None, __pyx_k_list_str_str_None, sizeof(__pyx_k_list_str_str_None), 0, 0, 1, 0},
    {&__pyx_n_s_listen, __pyx_k_listen, sizeof(__pyx_k_listen), 0, 0, 1, 1},
    {&__pyx_n_s_load_db, __pyx_k_load_db, sizeof(__pyx_k_load_db), 0, 0, 1, 1},
    {&__pyx_n_s_load_dotenv, __pyx_k_load_dotenv, sizeof(__pyx_k_load_dotenv), 0, 0, 1, 1},
    {&__pyx_n_s_load_pg, __pyx_k_load_pg, sizeof(__pyx_k_load_pg), 0, 0, 1, 1},
    {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1},
    {&__pyx_n_s_local, __pyx_k_local, sizeof(__pyx_k_local), 0, 0, 1, 1},
    {&__pyx_n_s_localhost, __pyx_k_localhost, sizeof(__pyx_k_localhost), 0, 0, 1, 1},
    {&__pyx_kp_u_lower_msg_like, __pyx_k_lower_msg_like, sizeof(__pyx_k_lower_msg_like), 0, 1, 0, 0},
    {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
    {&__pyx_n_s_main_2, __pyx_k_main_2, sizeof(__pyx_k_main_2), 0, 0, 1, 1},
    {&__pyx_n_s_max_connections, __pyx_k_max_connections, sizeof(__pyx_k_max_connections), 0, 0, 1, 1},
    {&__pyx_n_s_max_reconnect_attempts, __pyx_k_max_reconnect_attempts, sizeof(__pyx_k_max_reconnect_attempts), 0, 0, 1, 1},
    {&__pyx_n_s_max_workers, __pyx_k_max_workers, sizeof(__pyx_k_max_workers), 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_min_table_size, __pyx_k_min_table_size, sizeof(__pyx_k_min_table_size), 0, 0, 1, 1},
    {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
    {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1},
    {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
    {&__pyx_kp_u_msg_msg, __pyx_k_msg_msg, sizeof(__pyx_k_msg_msg), 0, 1, 0, 0},
    {&__pyx_kp_u_msg_trace_trace, __pyx_k_msg_trace_trace, sizeof(__pyx_k_msg_trace_trace), 0, 1, 0, 0},
    {&__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_new_bulk, __pyx_k_new_bulk, sizeof(__pyx_k_new_bulk), 0, 0, 1, 1},
    {&__pyx_n_s_new_key, __pyx_k_new_key, sizeof(__pyx_k_new_key), 0, 0, 1, 1},
    {&__pyx_n_s_new_output, __pyx_k_new_output, sizeof(__pyx_k_new_output), 0, 0, 1, 1},
    {&__pyx_n_b_nothing, __pyx_k_nothing, sizeof(__pyx_k_nothing), 0, 0, 0, 1},
    {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
    {&__pyx_n_b_ok, __pyx_k_ok, sizeof(__pyx_k_ok), 0, 0, 0, 1},
    {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
    {&__pyx_kp_u_or_epoch, __pyx_k_or_epoch, sizeof(__pyx_k_or_epoch), 0, 1, 0, 0},
    {&__pyx_kp_u_or_status, __pyx_k_or_status, sizeof(__pyx_k_or_status), 0, 1, 0, 0},
    {&__pyx_n_s_order_by, __pyx_k_order_by, sizeof(__pyx_k_order_by), 0, 0, 1, 1},
    {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
    {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1},
    {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
    {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1},
    {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1},
    {&__pyx_n_s_parent_statuses, __pyx_k_parent_statuses, sizeof(__pyx_k_parent_statuses), 0, 0, 1, 1},
    {&__pyx_n_s_parents, __pyx_k_parents, sizeof(__pyx_k_parents), 0, 0, 1, 1},
    {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
    {&__pyx_n_s_payload, __pyx_k_payload, sizeof(__pyx_k_payload), 0, 0, 1, 1},
    {&__pyx_n_s_pending, __pyx_k_pending, sizeof(__pyx_k_pending), 0, 0, 1, 1},
    {&__pyx_n_s_pending_2, __pyx_k_pending_2, sizeof(__pyx_k_pending_2), 0, 0, 1, 1},
    {&__pyx_n_s_pendings, __pyx_k_pendings, sizeof(__pyx_k_pendings), 0, 0, 1, 1},
    {&__pyx_n_s_persistqueue, __pyx_k_persistqueue, sizeof(__pyx_k_persistqueue), 0, 0, 1, 1},
    {&__pyx_n_s_pipe_debug, __pyx_k_pipe_debug, sizeof(__pyx_k_pipe_debug), 0, 0, 1, 1},
    {&__pyx_n_s_pipe_interpreter, __pyx_k_pipe_interpreter, sizeof(__pyx_k_pipe_interpreter), 0, 0, 1, 1},
    {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1},
    {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1},
    {&__pyx_n_s_postgres, __pyx_k_postgres, sizeof(__pyx_k_postgres), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_cancel, __pyx_k_postgres_cancel, sizeof(__pyx_k_postgres_cancel), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_cancels, __pyx_k_postgres_cancels, sizeof(__pyx_k_postgres_cancels), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_delete_steps, __pyx_k_postgres_delete_steps, sizeof(__pyx_k_postgres_delete_steps), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_done, __pyx_k_postgres_done, sizeof(__pyx_k_postgres_done), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_dones, __pyx_k_postgres_dones, sizeof(__pyx_k_postgres_dones), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_error, __pyx_k_postgres_error, sizeof(__pyx_k_postgres_error), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_fetch_errors, __pyx_k_postgres_fetch_errors, sizeof(__pyx_k_postgres_fetch_errors), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_get_rows, __pyx_k_postgres_get_rows, sizeof(__pyx_k_postgres_get_rows), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_get_step_count, __pyx_k_postgres_get_step_count, sizeof(__pyx_k_postgres_get_step_count), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_get_steps, __pyx_k_postgres_get_steps, sizeof(__pyx_k_postgres_get_steps), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_pending, __pyx_k_postgres_pending, sizeof(__pyx_k_postgres_pending), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_pendings, __pyx_k_postgres_pendings, sizeof(__pyx_k_postgres_pendings), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_repair, __pyx_k_postgres_repair, sizeof(__pyx_k_postgres_repair), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_reset, __pyx_k_postgres_reset, sizeof(__pyx_k_postgres_reset), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_reset_errors, __pyx_k_postgres_reset_errors, sizeof(__pyx_k_postgres_reset_errors), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_resets, __pyx_k_postgres_resets, sizeof(__pyx_k_postgres_resets), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_upload_step, __pyx_k_postgres_upload_step, sizeof(__pyx_k_postgres_upload_step), 0, 0, 1, 1},
    {&__pyx_n_s_postgres_upload_steps, __pyx_k_postgres_upload_steps, sizeof(__pyx_k_postgres_upload_steps), 0, 0, 1, 1},
    {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
    {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
    {&__pyx_n_s_print_exc, __pyx_k_print_exc, sizeof(__pyx_k_print_exc), 0, 0, 1, 1},
    {&__pyx_n_s_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 0, 1, 1},
    {&__pyx_kp_s_priority_ASC_epoch, __pyx_k_priority_ASC_epoch, sizeof(__pyx_k_priority_ASC_epoch), 0, 0, 1, 0},
    {&__pyx_kp_s_priority_DESC_epoch, __pyx_k_priority_DESC_epoch, sizeof(__pyx_k_priority_DESC_epoch), 0, 0, 1, 0},
    {&__pyx_kp_s_priority_asc_epoch, __pyx_k_priority_asc_epoch, sizeof(__pyx_k_priority_asc_epoch), 0, 0, 1, 0},
    {&__pyx_kp_s_priority_desc_epoch, __pyx_k_priority_desc_epoch, sizeof(__pyx_k_priority_desc_epoch), 0, 0, 1, 0},
    {&__pyx_n_s_process_request, __pyx_k_process_request, sizeof(__pyx_k_process_request), 0, 0, 1, 1},
    {&__pyx_n_s_process_transactions, __pyx_k_process_transactions, sizeof(__pyx_k_process_transactions), 0, 0, 1, 1},
    {&__pyx_n_s_processing, __pyx_k_processing, sizeof(__pyx_k_processing), 0, 0, 1, 1},
    {&__pyx_n_s_psycopg2, __pyx_k_psycopg2, sizeof(__pyx_k_psycopg2), 0, 0, 1, 1},
    {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1},
    {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1},
    {&__pyx_n_s_qs, __pyx_k_qs, sizeof(__pyx_k_qs), 0, 0, 1, 1},
    {&__pyx_n_s_qsize, __pyx_k_qsize, sizeof(__pyx_k_qsize), 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_string, __pyx_k_query_string, sizeof(__pyx_k_query_string), 0, 0, 1, 1},
    {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1},
    {&__pyx_n_s_queued, __pyx_k_queued, sizeof(__pyx_k_queued), 0, 0, 1, 1},
    {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
    {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
    {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
    {&__pyx_n_s_receive, __pyx_k_receive, sizeof(__pyx_k_receive), 0, 0, 1, 1},
    {&__pyx_n_s_received, __pyx_k_received, sizeof(__pyx_k_received), 0, 0, 1, 1},
    {&__pyx_n_s_recv, __pyx_k_recv, sizeof(__pyx_k_recv), 0, 0, 1, 1},
    {&__pyx_n_s_remove_data, __pyx_k_remove_data, sizeof(__pyx_k_remove_data), 0, 0, 1, 1},
    {&__pyx_n_s_remove_step, __pyx_k_remove_step, sizeof(__pyx_k_remove_step), 0, 0, 1, 1},
    {&__pyx_n_s_repair, __pyx_k_repair, sizeof(__pyx_k_repair), 0, 0, 1, 1},
    {&__pyx_n_s_request, __pyx_k_request, sizeof(__pyx_k_request), 0, 0, 1, 1},
    {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1},
    {&__pyx_n_s_reset_2, __pyx_k_reset_2, sizeof(__pyx_k_reset_2), 0, 0, 1, 1},
    {&__pyx_kp_b_reset_errors, __pyx_k_reset_errors, sizeof(__pyx_k_reset_errors), 0, 0, 0, 0},
    {&__pyx_kp_s_reset_errors, __pyx_k_reset_errors, sizeof(__pyx_k_reset_errors), 0, 0, 1, 0},
    {&__pyx_n_s_reset_errors_2, __pyx_k_reset_errors_2, sizeof(__pyx_k_reset_errors_2), 0, 0, 1, 1},
    {&__pyx_n_s_reset_errors_3, __pyx_k_reset_errors_3, sizeof(__pyx_k_reset_errors_3), 0, 0, 1, 1},
    {&__pyx_n_s_reset_tag_usage, __pyx_k_reset_tag_usage, sizeof(__pyx_k_reset_tag_usage), 0, 0, 1, 1},
    {&__pyx_n_s_resets, __pyx_k_resets, sizeof(__pyx_k_resets), 0, 0, 1, 1},
    {&__pyx_n_s_response, __pyx_k_response, sizeof(__pyx_k_response), 0, 0, 1, 1},
    {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
    {&__pyx_n_s_retries, __pyx_k_retries, sizeof(__pyx_k_retries), 0, 0, 1, 1},
    {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1},
    {&__pyx_n_s_return_job_def_id, __pyx_k_return_job_def_id, sizeof(__pyx_k_return_job_def_id), 0, 0, 1, 1},
    {&__pyx_n_s_return_job_ids, __pyx_k_return_job_ids, sizeof(__pyx_k_return_job_ids), 0, 0, 1, 1},
    {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1},
    {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1},
    {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1},
    {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
    {&__pyx_kp_u_s_scope, __pyx_k_s_scope, sizeof(__pyx_k_s_scope), 0, 1, 0, 0},
    {&__pyx_kp_u_s_scope_ANY_array, __pyx_k_s_scope_ANY_array, sizeof(__pyx_k_s_scope_ANY_array), 0, 1, 0, 0},
    {&__pyx_n_s_scope, __pyx_k_scope, sizeof(__pyx_k_scope), 0, 0, 1, 1},
    {&__pyx_n_s_scope_section, __pyx_k_scope_section, sizeof(__pyx_k_scope_section), 0, 0, 1, 1},
    {&__pyx_n_s_scopes, __pyx_k_scopes, sizeof(__pyx_k_scopes), 0, 0, 1, 1},
    {&__pyx_kp_u_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 1, 0, 0},
    {&__pyx_kp_u_select_buj_id_bsm_name_from_sel, __pyx_k_select_buj_id_bsm_name_from_sel, sizeof(__pyx_k_select_buj_id_bsm_name_from_sel), 0, 1, 0, 0},
    {&__pyx_kp_u_select_count_as_amount_min_prior, __pyx_k_select_count_as_amount_min_prior, sizeof(__pyx_k_select_count_as_amount_min_prior), 0, 1, 0, 0},
    {&__pyx_kp_s_select_from_buelon_jobs_where_st, __pyx_k_select_from_buelon_jobs_where_st, sizeof(__pyx_k_select_from_buelon_jobs_where_st), 0, 0, 1, 0},
    {&__pyx_kp_s_select_id_attempts_from_bue_sess, __pyx_k_select_id_attempts_from_bue_sess, sizeof(__pyx_k_select_id_attempts_from_bue_sess), 0, 0, 1, 0},
    {&__pyx_kp_u_select_id_status_from_buelon_job, __pyx_k_select_id_status_from_buelon_job, sizeof(__pyx_k_select_id_status_from_buelon_job), 0, 1, 0, 0},
    {&__pyx_kp_u_select_max_priority_as_priority, __pyx_k_select_max_priority_as_priority, sizeof(__pyx_k_select_max_priority_as_priority), 0, 1, 0, 0},
    {&__pyx_kp_u_select_status_count_as_amount_f, __pyx_k_select_status_count_as_amount_f, sizeof(__pyx_k_select_status_count_as_amount_f), 0, 1, 0, 0},
    {&__pyx_kp_u_select_status_count_as_amount_f_2, __pyx_k_select_status_count_as_amount_f_2, sizeof(__pyx_k_select_status_count_as_amount_f_2), 0, 1, 0, 0},
    {&__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_send_request, __pyx_k_send_request, sizeof(__pyx_k_send_request), 0, 0, 1, 1},
    {&__pyx_n_s_sendall, __pyx_k_sendall, sizeof(__pyx_k_sendall), 0, 0, 1, 1},
    {&__pyx_n_s_server, __pyx_k_server, sizeof(__pyx_k_server), 0, 0, 1, 1},
    {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1},
    {&__pyx_kp_s_set_None, __pyx_k_set_None, sizeof(__pyx_k_set_None), 0, 0, 1, 0},
    {&__pyx_n_s_set_data, __pyx_k_set_data, sizeof(__pyx_k_set_data), 0, 0, 1, 1},
    {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
    {&__pyx_n_s_set_step, __pyx_k_set_step, sizeof(__pyx_k_set_step), 0, 0, 1, 1},
    {&__pyx_n_s_set_steps, __pyx_k_set_steps, sizeof(__pyx_k_set_steps), 0, 0, 1, 1},
    {&__pyx_n_s_setdefaulttimeout, __pyx_k_setdefaulttimeout, sizeof(__pyx_k_setdefaulttimeout), 0, 0, 1, 1},
    {&__pyx_n_s_setsockopt, __pyx_k_setsockopt, sizeof(__pyx_k_setsockopt), 0, 0, 1, 1},
    {&__pyx_n_s_settimeout, __pyx_k_settimeout, sizeof(__pyx_k_settimeout), 0, 0, 1, 1},
    {&__pyx_n_s_should_finish, __pyx_k_should_finish, sizeof(__pyx_k_should_finish), 0, 0, 1, 1},
    {&__pyx_n_s_shutdown, __pyx_k_shutdown, sizeof(__pyx_k_shutdown), 0, 0, 1, 1},
    {&__pyx_n_s_signal, __pyx_k_signal, sizeof(__pyx_k_signal), 0, 0, 1, 1},
    {&__pyx_kp_s_signal_only_works_in_main_thread, __pyx_k_signal_only_works_in_main_thread, sizeof(__pyx_k_signal_only_works_in_main_thread), 0, 0, 1, 0},
    {&__pyx_n_s_signum, __pyx_k_signum, sizeof(__pyx_k_signum), 0, 0, 1, 1},
    {&__pyx_n_s_sleep, __pyx_k_sleep, sizeof(__pyx_k_sleep), 0, 0, 1, 1},
    {&__pyx_n_s_socket, __pyx_k_socket, sizeof(__pyx_k_socket), 0, 0, 1, 1},
    {&__pyx_kp_s_socket_socket, __pyx_k_socket_socket, sizeof(__pyx_k_socket_socket), 0, 0, 1, 0},
    {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 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_set_to_working, __pyx_k_sql_set_to_working, sizeof(__pyx_k_sql_set_to_working), 0, 0, 1, 1},
    {&__pyx_n_s_sql_update_children, __pyx_k_sql_update_children, sizeof(__pyx_k_sql_update_children), 0, 0, 1, 1},
    {&__pyx_n_s_sql_update_step, __pyx_k_sql_update_step, sizeof(__pyx_k_sql_update_step), 0, 0, 1, 1},
    {&__pyx_n_s_sqlite3, __pyx_k_sqlite3, sizeof(__pyx_k_sqlite3), 0, 0, 1, 1},
    {&__pyx_n_s_ss, __pyx_k_ss, sizeof(__pyx_k_ss), 0, 0, 1, 1},
    {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
    {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
    {&__pyx_kp_u_state_archived_WHERE, __pyx_k_state_archived_WHERE, sizeof(__pyx_k_state_archived_WHERE), 0, 1, 0, 0},
    {&__pyx_kp_u_state_archived_WHERE_id, __pyx_k_state_archived_WHERE_id, sizeof(__pyx_k_state_archived_WHERE_id), 0, 1, 0, 0},
    {&__pyx_kp_u_state_waiting_WHERE, __pyx_k_state_waiting_WHERE, sizeof(__pyx_k_state_waiting_WHERE), 0, 1, 0, 0},
    {&__pyx_kp_u_state_waiting_WHERE_id, __pyx_k_state_waiting_WHERE_id, sizeof(__pyx_k_state_waiting_WHERE_id), 0, 1, 0, 0},
    {&__pyx_n_s_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1},
    {&__pyx_n_s_status_value, __pyx_k_status_value, sizeof(__pyx_k_status_value), 0, 0, 1, 1},
    {&__pyx_n_s_status_values, __pyx_k_status_values, sizeof(__pyx_k_status_values), 0, 0, 1, 1},
    {&__pyx_n_s_statuses, __pyx_k_statuses, sizeof(__pyx_k_statuses), 0, 0, 1, 1},
    {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1},
    {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
    {&__pyx_n_s_step_2, __pyx_k_step_2, sizeof(__pyx_k_step_2), 0, 0, 1, 1},
    {&__pyx_kp_u_step_3, __pyx_k_step_3, sizeof(__pyx_k_step_3), 0, 1, 0, 0},
    {&__pyx_kp_b_step_count, __pyx_k_step_count, sizeof(__pyx_k_step_count), 0, 0, 0, 0},
    {&__pyx_kp_s_step_count, __pyx_k_step_count, sizeof(__pyx_k_step_count), 0, 0, 1, 0},
    {&__pyx_kp_u_step_data, __pyx_k_step_data, sizeof(__pyx_k_step_data), 0, 1, 0, 0},
    {&__pyx_n_s_step_id, __pyx_k_step_id, sizeof(__pyx_k_step_id), 0, 0, 1, 1},
    {&__pyx_n_s_step_ids, __pyx_k_step_ids, sizeof(__pyx_k_step_ids), 0, 0, 1, 1},
    {&__pyx_n_s_step_json, __pyx_k_step_json, sizeof(__pyx_k_step_json), 0, 0, 1, 1},
    {&__pyx_n_s_step_jsons, __pyx_k_step_jsons, sizeof(__pyx_k_step_jsons), 0, 0, 1, 1},
    {&__pyx_n_s_steps, __pyx_k_steps, sizeof(__pyx_k_steps), 0, 0, 1, 1},
    {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
    {&__pyx_kp_s_str_None, __pyx_k_str_None, sizeof(__pyx_k_str_None), 0, 0, 1, 0},
    {&__pyx_kp_s_str_list_str_None, __pyx_k_str_list_str_None, sizeof(__pyx_k_str_list_str_None), 0, 0, 1, 0},
    {&__pyx_kp_s_str_list_str_tuple_str_list_str, __pyx_k_str_list_str_tuple_str_list_str, sizeof(__pyx_k_str_list_str_tuple_str_list_str), 0, 0, 1, 0},
    {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1},
    {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
    {&__pyx_n_s_submit, __pyx_k_submit, sizeof(__pyx_k_submit), 0, 0, 1, 1},
    {&__pyx_kp_u_submit_jobs, __pyx_k_submit_jobs, sizeof(__pyx_k_submit_jobs), 0, 1, 0, 0},
    {&__pyx_n_s_submit_pipe_code, __pyx_k_submit_pipe_code, sizeof(__pyx_k_submit_pipe_code), 0, 0, 1, 1},
    {&__pyx_n_s_submit_pipe_code_from_file, __pyx_k_submit_pipe_code_from_file, sizeof(__pyx_k_submit_pipe_code_from_file), 0, 0, 1, 1},
    {&__pyx_n_s_success, __pyx_k_success, sizeof(__pyx_k_success), 0, 0, 1, 1},
    {&__pyx_n_s_suffix, __pyx_k_suffix, sizeof(__pyx_k_suffix), 0, 0, 1, 1},
    {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
    {&__pyx_n_s_sync, __pyx_k_sync, sizeof(__pyx_k_sync), 0, 0, 1, 1},
    {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
    {&__pyx_n_s_system, __pyx_k_system, sizeof(__pyx_k_system), 0, 0, 1, 1},
    {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1},
    {&__pyx_n_s_tag, __pyx_k_tag, sizeof(__pyx_k_tag), 0, 0, 1, 1},
    {&__pyx_n_s_tag_lock, __pyx_k_tag_lock, sizeof(__pyx_k_tag_lock), 0, 0, 1, 1},
    {&__pyx_n_s_tag_usage, __pyx_k_tag_usage, sizeof(__pyx_k_tag_usage), 0, 0, 1, 1},
    {&__pyx_n_s_tag_velocities, __pyx_k_tag_velocities, sizeof(__pyx_k_tag_velocities), 0, 0, 1, 1},
    {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1},
    {&__pyx_n_s_task_done, __pyx_k_task_done, sizeof(__pyx_k_task_done), 0, 0, 1, 1},
    {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
    {&__pyx_n_s_thread, __pyx_k_thread, sizeof(__pyx_k_thread), 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_timeout_duration, __pyx_k_timeout_duration, sizeof(__pyx_k_timeout_duration), 0, 0, 1, 1},
    {&__pyx_n_s_timeout_func, __pyx_k_timeout_func, sizeof(__pyx_k_timeout_func), 0, 0, 1, 1},
    {&__pyx_n_s_timeout_func_locals_CustomTimeou, __pyx_k_timeout_func_locals_CustomTimeou, sizeof(__pyx_k_timeout_func_locals_CustomTimeou), 0, 0, 1, 1},
    {&__pyx_n_s_timeout_func_locals_handler, __pyx_k_timeout_func_locals_handler, sizeof(__pyx_k_timeout_func_locals_handler), 0, 0, 1, 1},
    {&__pyx_n_s_to_json, __pyx_k_to_json, sizeof(__pyx_k_to_json), 0, 0, 1, 1},
    {&__pyx_n_s_total, __pyx_k_total, sizeof(__pyx_k_total), 0, 0, 1, 1},
    {&__pyx_n_s_tqdm, __pyx_k_tqdm, sizeof(__pyx_k_tqdm), 0, 0, 1, 1},
    {&__pyx_n_s_trace, __pyx_k_trace, sizeof(__pyx_k_trace), 0, 0, 1, 1},
    {&__pyx_kp_u_trace_state_waiting_WHERE_id, __pyx_k_trace_state_waiting_WHERE_id, sizeof(__pyx_k_trace_state_waiting_WHERE_id), 0, 1, 0, 0},
    {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
    {&__pyx_n_s_transaction_queue, __pyx_k_transaction_queue, sizeof(__pyx_k_transaction_queue), 0, 0, 1, 1},
    {&__pyx_n_b_true, __pyx_k_true, sizeof(__pyx_k_true), 0, 0, 0, 1},
    {&__pyx_n_s_true, __pyx_k_true, sizeof(__pyx_k_true), 0, 0, 1, 1},
    {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
    {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1},
    {&__pyx_n_s_unsync, __pyx_k_unsync, sizeof(__pyx_k_unsync), 0, 0, 1, 1},
    {&__pyx_kp_u_update_bue_session_ids_set_attem, __pyx_k_update_bue_session_ids_set_attem, sizeof(__pyx_k_update_bue_session_ids_set_attem), 0, 1, 0, 0},
    {&__pyx_kp_u_update_buelon_jobs_set_status, __pyx_k_update_buelon_jobs_set_status, sizeof(__pyx_k_update_buelon_jobs_set_status), 0, 1, 0, 0},
    {&__pyx_n_s_update_params, __pyx_k_update_params, sizeof(__pyx_k_update_params), 0, 0, 1, 1},
    {&__pyx_n_s_update_query, __pyx_k_update_query, sizeof(__pyx_k_update_query), 0, 0, 1, 1},
    {&__pyx_kp_u_update_steps_set_status, __pyx_k_update_steps_set_status, sizeof(__pyx_k_update_steps_set_status), 0, 1, 0, 0},
    {&__pyx_n_s_upload_pipe_code, __pyx_k_upload_pipe_code, sizeof(__pyx_k_upload_pipe_code), 0, 0, 1, 1},
    {&__pyx_n_s_upload_pipe_code_from_file, __pyx_k_upload_pipe_code_from_file, sizeof(__pyx_k_upload_pipe_code_from_file), 0, 0, 1, 1},
    {&__pyx_n_s_upload_pipe_code_locals_genexpr, __pyx_k_upload_pipe_code_locals_genexpr, sizeof(__pyx_k_upload_pipe_code_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_kp_b_upload_step, __pyx_k_upload_step, sizeof(__pyx_k_upload_step), 0, 0, 0, 0},
    {&__pyx_kp_s_upload_step, __pyx_k_upload_step, sizeof(__pyx_k_upload_step), 0, 0, 1, 0},
    {&__pyx_n_s_upload_step_2, __pyx_k_upload_step_2, sizeof(__pyx_k_upload_step_2), 0, 0, 1, 1},
    {&__pyx_n_s_upload_step_3, __pyx_k_upload_step_3, sizeof(__pyx_k_upload_step_3), 0, 0, 1, 1},
    {&__pyx_n_s_upload_steps, __pyx_k_upload_steps, sizeof(__pyx_k_upload_steps), 0, 0, 1, 1},
    {&__pyx_n_s_upload_steps_2, __pyx_k_upload_steps_2, sizeof(__pyx_k_upload_steps_2), 0, 0, 1, 1},
    {&__pyx_kp_s_upload_steps_3, __pyx_k_upload_steps_3, sizeof(__pyx_k_upload_steps_3), 0, 0, 1, 0},
    {&__pyx_n_s_upload_table, __pyx_k_upload_table, sizeof(__pyx_k_upload_table), 0, 0, 1, 1},
    {&__pyx_n_s_uuid, __pyx_k_uuid, sizeof(__pyx_k_uuid), 0, 0, 1, 1},
    {&__pyx_n_s_uuid1, __pyx_k_uuid1, sizeof(__pyx_k_uuid1), 0, 0, 1, 1},
    {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
    {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
    {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
    {&__pyx_n_s_velocity, __pyx_k_velocity, sizeof(__pyx_k_velocity), 0, 0, 1, 1},
    {&__pyx_n_s_velocity_sql, __pyx_k_velocity_sql, sizeof(__pyx_k_velocity_sql), 0, 0, 1, 1},
    {&__pyx_n_s_wait_until_finish, __pyx_k_wait_until_finish, sizeof(__pyx_k_wait_until_finish), 0, 0, 1, 1},
    {&__pyx_n_s_waiting, __pyx_k_waiting, sizeof(__pyx_k_waiting), 0, 0, 1, 1},
    {&__pyx_n_s_waiting_priority, __pyx_k_waiting_priority, sizeof(__pyx_k_waiting_priority), 0, 0, 1, 1},
    {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
    {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
    {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1},
    {&__pyx_kp_u_where_status, __pyx_k_where_status, sizeof(__pyx_k_where_status), 0, 1, 0, 0},
    {&__pyx_kp_u_where_status_2, __pyx_k_where_status_2, sizeof(__pyx_k_where_status_2), 0, 1, 0, 0},
    {&__pyx_kp_u_where_status_not_in, __pyx_k_where_status_not_in, sizeof(__pyx_k_where_status_not_in), 0, 1, 0, 0},
    {&__pyx_kp_u_where_status_not_in_2, __pyx_k_where_status_not_in_2, sizeof(__pyx_k_where_status_not_in_2), 0, 1, 0, 0},
    {&__pyx_n_s_worker, __pyx_k_worker, sizeof(__pyx_k_worker), 0, 0, 1, 1},
    {&__pyx_n_s_worker_thread, __pyx_k_worker_thread, sizeof(__pyx_k_worker_thread), 0, 0, 1, 1},
    {&__pyx_n_s_working, __pyx_k_working, sizeof(__pyx_k_working), 0, 0, 1, 1},
    {&__pyx_n_s_working_clause, __pyx_k_working_clause, sizeof(__pyx_k_working_clause), 0, 0, 1, 1},
    {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
    {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
    {0, 0, 0, 0, 0, 0, 0}
  };
  return __Pyx_InitStrings(__pyx_string_tab);
}
/* #### Code section: cached_builtins ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 116, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 271, __pyx_L1_error)
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 353, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 430, __pyx_L1_error)
  __pyx_builtin_all = __Pyx_GetBuiltinName(__pyx_n_s_all); if (!__pyx_builtin_all) __PYX_ERR(0, 590, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 875, __pyx_L1_error)
  __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 1006, __pyx_L1_error)
  __pyx_builtin_exit = __Pyx_GetBuiltinName(__pyx_n_s_exit); if (!__pyx_builtin_exit) __PYX_ERR(0, 1027, __pyx_L1_error)
  __pyx_builtin_KeyboardInterrupt = __Pyx_GetBuiltinName(__pyx_n_s_KeyboardInterrupt); if (!__pyx_builtin_KeyboardInterrupt) __PYX_ERR(0, 1067, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 1997, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "buelon/cython/c_hub.pyx":91
 *         pass
 * 
 *     def handler(signum, frame):             # <<<<<<<<<<<<<<
 *         raise CustomTimeoutError()
 * 
 */
  __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_s_signum, __pyx_n_s_frame); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);
  __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_handler, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 91, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":125
 * 
 * def load_db():
 *     with sqlite3.connect(db_path) as conn:             # <<<<<<<<<<<<<<
 *         cur = conn.cursor()
 *         cur.execute('PRAGMA journal_mode=WAL')
 */
  __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "buelon/cython/c_hub.pyx":144
 * 
 * def delete_steps():
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')             # <<<<<<<<<<<<<<
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 */
  __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_PIPE_WORKER_HOST, __pyx_n_s_localhost); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "buelon/cython/c_hub.pyx":145
 * def delete_steps():
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))             # <<<<<<<<<<<<<<
 *     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
 *         s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
 */
  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_PIPE_WORKER_PORT, __pyx_int_65432); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "buelon/cython/c_hub.pyx":364
 *                     print('Error:', row['msg'])
 *                     # print('Trace:', row['trace'])
 *                     print('')  # last line deleted             # <<<<<<<<<<<<<<
 *                     if key_map[row['id']] > 3:
 *                         raise Exception('Max errors met')
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s__3); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "buelon/cython/c_hub.pyx":366
 *                     print('')  # last line deleted
 *                     if key_map[row['id']] > 3:
 *                         raise Exception('Max errors met')             # <<<<<<<<<<<<<<
 *                     client.reset_errors(False)
 *                     cur.execute(f'update bue_session_ids set attempts = attempts + 1 where id = \'{row["id"]}\';')
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Max_errors_met); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "buelon/cython/c_hub.pyx":376
 *         conn.commit()
 *         conn.close()
 *         print('Done')             # <<<<<<<<<<<<<<
 * 
 *     if return_job_ids:
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_Done); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "buelon/cython/c_hub.pyx":717
 * def _fetch_errors(self: HubServer, count: int, exclude: list[str] | str | None = None) -> dict:
 *     if not isinstance(count, int):
 *         raise ValueError('count must be an integer')             # <<<<<<<<<<<<<<
 * 
 *     if not isinstance(exclude, (type(None), str, list)):
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_count_must_be_an_integer); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "buelon/cython/c_hub.pyx":720
 * 
 *     if not isinstance(exclude, (type(None), str, list)):
 *         raise ValueError('exclude must be a string or a list')             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(exclude, list):
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_exclude_must_be_a_string_or_a_li); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "buelon/cython/c_hub.pyx":724
 *     if isinstance(exclude, list):
 *         if not all(isinstance(x, str) for x in exclude):
 *             raise ValueError('exclude must be a list of strings')             # <<<<<<<<<<<<<<
 * 
 *     allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_exclude_must_be_a_list_of_string); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "buelon/cython/c_hub.pyx":727
 * 
 *     allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 *     def clean_query_string(query_string: str) -> str:             # <<<<<<<<<<<<<<
 *         return ''.join(c for c in query_string if c in allow_chars)
 * 
 */
  __pyx_tuple__28 = PyTuple_Pack(3, __pyx_n_s_query_string, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);
  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_clean_query_string, 727, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 727, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":975
 *         self.transaction_queue = queue.Queue()
 *         # self.execution_queue = queue.Queue()
 *         self.execution_queue = ThreadSafeSQLiteQueue('execution_queue', auto_commit=True)  # persistqueue.SQLiteQueue('execution_queue', auto_commit=True)             # <<<<<<<<<<<<<<
 *         self.db_pool = self.create_db_pool()
 * 
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_s_execution_queue); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "buelon/cython/c_hub.pyx":982
 * 
 *     def execute_db_query(self, query, params=None, json_table=False):
 *         def db_operation():             # <<<<<<<<<<<<<<
 *             with sqlite3.connect(db_path) as conn:
 *                 cur = conn.cursor()
 */
  __pyx_tuple__37 = PyTuple_Pack(6, __pyx_n_s_conn, __pyx_n_s_cur, __pyx_n_s_headers, __pyx_n_s_table, __pyx_n_s_row, __pyx_n_s_row); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);
  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_db_operation, 982, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 982, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1183
 *             try:
 *                 config = buelon.helpers.json_parser.loads(payload)
 *                 count = int(config.get('count', 5))             # <<<<<<<<<<<<<<
 *                 exclude = config.get('exclude', None)
 * 
 */
  __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_count, __pyx_int_5); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 1183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "buelon/cython/c_hub.pyx":1184
 *                 config = buelon.helpers.json_parser.loads(payload)
 *                 count = int(config.get('count', 5))
 *                 exclude = config.get('exclude', None)             # <<<<<<<<<<<<<<
 * 
 *                 if not isinstance(exclude, (type(None), str, list)):
 */
  __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_exclude, Py_None); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 1184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "buelon/cython/c_hub.pyx":1535
 *             ], id_column='value')
 *         except buelon.helpers.postgres.psycopg2.errors.InsufficientPrivilege:
 *             print('Insufficient privileges to create table.')             # <<<<<<<<<<<<<<
 * 
 *     def postgres_get_steps(
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Insufficient_privileges_to_creat); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 1535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "buelon/cython/c_hub.pyx":1637
 *         rows = self.db.download_table(sql=query)
 * 
 *         def check_active_state(min_table_size, scope_section, working_clause, order_by):             # <<<<<<<<<<<<<<
 *             db = buelon.helpers.postgres.get_postgres_from_env()
 *             row = db.download_table(sql=f'select count(*) as amount, min(priority) as priority from buelon_jobs_active where status != \'{buelon.core.step.StepStatus.working.value}\';')[0]
 */
  __pyx_tuple__46 = PyTuple_Pack(10, __pyx_n_s_min_table_size, __pyx_n_s_scope_section, __pyx_n_s_working_clause, __pyx_n_s_order_by, __pyx_n_s_db, __pyx_n_s_row, __pyx_n_s_amount, __pyx_n_s_priority, __pyx_n_s_waiting_priority, __pyx_n_s_query); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 1637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);
  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_check_active_state, 1637, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 1637, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1927
 *         allow_chars = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,!@#$^&*()_+=-[]{};:"|,.<>/?~`|'
 * 
 *         def clean_query_string(query_string: str) -> str:             # <<<<<<<<<<<<<<
 *             return ''.join(c for c in query_string if c in allow_chars)
 * 
 */
  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_clean_query_string, 1927, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 1927, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1961
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 *         print('Fetching queued (not finished) jobs')             # <<<<<<<<<<<<<<
 *         rows = self.db.download_table(sql='select * from buelon_jobs where status =\'2\'')
 *         ss = [bulk_get_step([row['id'] for row in rows[i:i+1000]]) for i in tqdm.tqdm(range(0, len(rows), 1000), desc='Fetching data for jobs by 1,000\'s')]
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_Fetching_queued_not_finished_job); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 1961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "buelon/cython/c_hub.pyx":1967
 *         parents = [p for s in steps for p in s.parents]
 * 
 *         def get_statuses(ids: list[str]):             # <<<<<<<<<<<<<<
 *             return {
 *                 row['id']: row['status'] for row in
 */
  __pyx_tuple__53 = PyTuple_Pack(3, __pyx_n_s_ids, __pyx_n_s_row, __pyx_n_s_i); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 1967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);
  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_get_statuses, 1967, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 1967, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1979
 *                 parent_statuses[p] = parent_statuses.get(p, f'{buelon.core.step.StepStatus.success.value}')
 * 
 *         def should_finish(s: buelon.core.step.Step):             # <<<<<<<<<<<<<<
 *             # return all(parent_statuses[p] in [f'{buelon.core.step.StepStatus.success.value}', f'{buelon.core.step.StepStatus.cancel.value}'] for p in s.parents)
 *             return all(parent_statuses[p] == f'{buelon.core.step.StepStatus.success.value}' for p in s.parents)
 */
  __pyx_tuple__55 = PyTuple_Pack(3, __pyx_n_s_s, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 1979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);
  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_should_finish, 1979, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 1979, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":25
 * try:
 *     import dotenv
 *     dotenv.load_dotenv('.env')             # <<<<<<<<<<<<<<
 * except ModuleNotFoundError:
 *     pass
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_env); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "buelon/cython/c_hub.pyx":29
 *     pass
 * 
 * import buelon.bucket             # <<<<<<<<<<<<<<
 * import buelon.core.step
 * import buelon.core.pipe_interpreter
 */
  __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_buelon, __pyx_n_s_bucket); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "buelon/cython/c_hub.pyx":30
 * 
 * import buelon.bucket
 * import buelon.core.step             # <<<<<<<<<<<<<<
 * import buelon.core.pipe_interpreter
 * import buelon.helpers.json_parser
 */
  __pyx_tuple__59 = PyTuple_Pack(3, __pyx_n_s_buelon, __pyx_n_s_core, __pyx_n_s_step); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "buelon/cython/c_hub.pyx":31
 * import buelon.bucket
 * import buelon.core.step
 * import buelon.core.pipe_interpreter             # <<<<<<<<<<<<<<
 * import buelon.helpers.json_parser
 * import buelon.core.pipe_debug
 */
  __pyx_tuple__60 = PyTuple_Pack(3, __pyx_n_s_buelon, __pyx_n_s_core, __pyx_n_s_pipe_interpreter); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "buelon/cython/c_hub.pyx":32
 * import buelon.core.step
 * import buelon.core.pipe_interpreter
 * import buelon.helpers.json_parser             # <<<<<<<<<<<<<<
 * import buelon.core.pipe_debug
 * import buelon.helpers.lazy_load_class
 */
  __pyx_tuple__61 = PyTuple_Pack(3, __pyx_n_s_buelon, __pyx_n_s_helpers, __pyx_n_s_json_parser); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "buelon/cython/c_hub.pyx":33
 * import buelon.core.pipe_interpreter
 * import buelon.helpers.json_parser
 * import buelon.core.pipe_debug             # <<<<<<<<<<<<<<
 * import buelon.helpers.lazy_load_class
 * 
 */
  __pyx_tuple__62 = PyTuple_Pack(3, __pyx_n_s_buelon, __pyx_n_s_core, __pyx_n_s_pipe_debug); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "buelon/cython/c_hub.pyx":34
 * import buelon.helpers.json_parser
 * import buelon.core.pipe_debug
 * import buelon.helpers.lazy_load_class             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__63 = PyTuple_Pack(3, __pyx_n_s_buelon, __pyx_n_s_helpers, __pyx_n_s_lazy_load_class); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "buelon/cython/c_hub.pyx":53
 * 
 * 
 * USING_POSTGRES = os.environ.get('USING_POSTGRES_HUB', 'false') == 'true'             # <<<<<<<<<<<<<<
 * PIPELINE_HOST = os.environ.get('PIPELINE_HOST', '0.0.0.0')
 * PIPELINE_PORT = int(os.environ.get('PIPELINE_PORT', 65432))
 */
  __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_USING_POSTGRES_HUB, __pyx_n_s_false); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "buelon/cython/c_hub.pyx":54
 * 
 * USING_POSTGRES = os.environ.get('USING_POSTGRES_HUB', 'false') == 'true'
 * PIPELINE_HOST = os.environ.get('PIPELINE_HOST', '0.0.0.0')             # <<<<<<<<<<<<<<
 * PIPELINE_PORT = int(os.environ.get('PIPELINE_PORT', 65432))
 * 
 */
  __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_PIPELINE_HOST, __pyx_kp_s_0_0_0_0); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "buelon/cython/c_hub.pyx":55
 * USING_POSTGRES = os.environ.get('USING_POSTGRES_HUB', 'false') == 'true'
 * PIPELINE_HOST = os.environ.get('PIPELINE_HOST', '0.0.0.0')
 * PIPELINE_PORT = int(os.environ.get('PIPELINE_PORT', 65432))             # <<<<<<<<<<<<<<
 * 
 * db_path = os.path.join('database.db')
 */
  __pyx_tuple__66 = PyTuple_Pack(2, __pyx_n_s_PIPELINE_PORT, __pyx_int_65432); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "buelon/cython/c_hub.pyx":57
 * PIPELINE_PORT = int(os.environ.get('PIPELINE_PORT', 65432))
 * 
 * db_path = os.path.join('database.db')             # <<<<<<<<<<<<<<
 * 
 * bucket_client = buelon.bucket.Client()
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_database_db); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "buelon/cython/c_hub.pyx":74
 * 
 * 
 * def delete_last_line():             # <<<<<<<<<<<<<<
 *     sys.stdout.write("\033[F")
 *     sys.stdout.write("\033[K")
 */
  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_delete_last_line, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 74, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":79
 * 
 * 
 * def timeout_func(func, args=None, kwargs=None, timeout_duration=1, default=None):             # <<<<<<<<<<<<<<
 *     if args is None: args = []
 *     if kwargs is None: kwargs = {}
 */
  __pyx_tuple__71 = PyTuple_Pack(10, __pyx_n_s_func, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_timeout_duration, __pyx_n_s_default, __pyx_n_s_CustomTimeoutError, __pyx_n_s_handler, __pyx_n_s_handler, __pyx_n_s_result, __pyx_n_s_exc); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);
  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_timeout_func, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 79, __pyx_L1_error)
  __pyx_tuple__73 = PyTuple_Pack(4, Py_None, Py_None, ((PyObject *)__pyx_int_1), Py_None); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "buelon/cython/c_hub.pyx":107
 * 
 * 
 * def receive(conn: socket.socket) -> bytes:             # <<<<<<<<<<<<<<
 *     data = b''
 *     while not data.endswith(PIPELINE_END_TOKEN):
 */
  __pyx_tuple__74 = PyTuple_Pack(3, __pyx_n_s_conn, __pyx_n_s_data, __pyx_n_s_v); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);
  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_receive, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 107, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":120
 * 
 * 
 * def send(conn: socket.socket, data: bytes) -> None:             # <<<<<<<<<<<<<<
 *     conn.sendall(data+PIPELINE_END_TOKEN)
 * 
 */
  __pyx_tuple__76 = PyTuple_Pack(2, __pyx_n_s_conn, __pyx_n_s_data); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_send, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 120, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":124
 * 
 * 
 * def load_db():             # <<<<<<<<<<<<<<
 *     with sqlite3.connect(db_path) as conn:
 *         cur = conn.cursor()
 */
  __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_conn, __pyx_n_s_cur); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);
  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_load_db, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 124, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":143
 * 
 * 
 * def delete_steps():             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */
  __pyx_tuple__80 = PyTuple_Pack(4, __pyx_n_s_WORKER_HOST, __pyx_n_s_WORKER_PORT, __pyx_n_s_s, __pyx_n_s_data); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);
  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_delete_steps_3, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 143, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":155
 * 
 * 
 * def _delete_steps(self: HubServer):             # <<<<<<<<<<<<<<
 *     self.execute_db_query('delete from steps;')
 *     # with sqlite3.connect(db_path) as conn:
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);
  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_delete_steps_2, 155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 155, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":163
 * 
 * 
 * def reset_errors(include_workers=False):             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */
  __pyx_tuple__84 = PyTuple_Pack(5, __pyx_n_s_include_workers, __pyx_n_s_WORKER_HOST, __pyx_n_s_WORKER_PORT, __pyx_n_s_s, __pyx_n_s_data); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);
  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_reset_errors_2, 163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 163, __pyx_L1_error)
  __pyx_tuple__86 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "buelon/cython/c_hub.pyx":175
 * 
 * 
 * def _reset_errors(self: HubServer, include_workers=b'false'):             # <<<<<<<<<<<<<<
 *     suffix = '' if include_workers != b'true' else f' or status = \'{buelon.core.step.StepStatus.working.value}\''
 *     query = f'''
 */
  __pyx_tuple__87 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_include_workers, __pyx_n_s_suffix, __pyx_n_s_query); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);
  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_reset_errors_3, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 175, __pyx_L1_error)
  __pyx_tuple__89 = PyTuple_Pack(1, ((PyObject*)__pyx_n_b_false)); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "buelon/cython/c_hub.pyx":189
 * 
 * 
 * def get_step_count(types: str | None = None) -> list[dict]:             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */
  __pyx_tuple__90 = PyTuple_Pack(5, __pyx_n_s_types, __pyx_n_s_WORKER_HOST, __pyx_n_s_WORKER_PORT, __pyx_n_s_s, __pyx_n_s_data); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_get_step_count_2, 189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 189, __pyx_L1_error)
  __pyx_tuple__92 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "buelon/cython/c_hub.pyx":202
 * 
 * 
 * def _get_step_count(self: HubServer, types: str | None = None) -> list[dict]:             # <<<<<<<<<<<<<<
 *     if types == '*':
 *         where = ''
 */
  __pyx_tuple__93 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_types, __pyx_n_s_where, __pyx_n_s_query, __pyx_n_s_table, __pyx_n_s_row); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);
  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_get_step_count, 202, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 202, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":241
 * 
 * 
 * def upload_step(_step: buelon.core.step.Step, status: buelon.core.step.StepStatus) -> None:             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */
  __pyx_tuple__95 = PyTuple_Pack(6, __pyx_n_s_step_2, __pyx_n_s_status, __pyx_n_s_WORKER_HOST, __pyx_n_s_WORKER_PORT, __pyx_n_s_s, __pyx_n_s_data); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);
  __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_upload_step_3, 241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 241, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":253
 * 
 * 
 * def _upload_step(self: HubServer, step_json: dict, status_value: int) -> None:             # <<<<<<<<<<<<<<
 *     status = buelon.core.step.StepStatus(status_value)
 *     _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 */
  __pyx_tuple__97 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_step_json, __pyx_n_s_status_value, __pyx_n_s_status, __pyx_n_s_step_2, __pyx_n_s_sql, __pyx_n_s_params); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);
  __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_upload_step_2, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 253, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":268
 * 
 * 
 * def _upload_steps(self: HubServer, step_jsons: list, status_values: list) -> None:             # <<<<<<<<<<<<<<
 *     sql = ('INSERT INTO steps (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace) '
 *            'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);')
 */
  __pyx_tuple__99 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_step_jsons, __pyx_n_s_status_values, __pyx_n_s_sql, __pyx_n_s_step_json, __pyx_n_s_status_value, __pyx_n_s_status, __pyx_n_s_step_2, __pyx_n_s_params); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);
  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_upload_steps_2, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 268, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":288
 * 
 * 
 * def upload_pipe_code(             # <<<<<<<<<<<<<<
 *         code: str,
 *         lazy_steps: bool = False,
 */
  __pyx_tuple__101 = PyTuple_Pack(25, __pyx_n_s_code, __pyx_n_s_lazy_steps, __pyx_n_s_wait_until_finish, __pyx_n_s_return_job_ids, __pyx_n_s_return_job_def_id, __pyx_n_s_job_handler, __pyx_n_s_client, __pyx_n_s_chunk_size, __pyx_n_s_chunk, __pyx_n_s_statuses, __pyx_n_s_pending, __pyx_n_s_queued, __pyx_n_s_job_ids, __pyx_n_s_conn, __pyx_n_s_cur, __pyx_n_s_job, __pyx_n_s_i, __pyx_n_s_key_map, __pyx_n_s_row, __pyx_n_s_s, __pyx_n_s_s, __pyx_n_s_rows, __pyx_n_s_row, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 25, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_upload_pipe_code, 288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 288, __pyx_L1_error)
  __pyx_tuple__103 = PyTuple_Pack(5, ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)Py_False), Py_None, Py_None); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);

  /* "buelon/cython/c_hub.pyx":429
 * 
 * 
 * def upload_pipe_code_from_file(file_path: str, lazy_steps: bool = False, wait_until_finish: bool = False):             # <<<<<<<<<<<<<<
 *     with open(file_path, 'r') as f:
 *         code = f.read()
 */
  __pyx_tuple__104 = PyTuple_Pack(5, __pyx_n_s_file_path, __pyx_n_s_lazy_steps, __pyx_n_s_wait_until_finish, __pyx_n_s_f, __pyx_n_s_code); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);
  __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_upload_pipe_code_from_file, 429, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 429, __pyx_L1_error)
  __pyx_tuple__106 = PyTuple_Pack(2, ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "buelon/cython/c_hub.pyx":435
 * 
 * 
 * def submit_pipe_code_from_file(file_path: str, scope: str | None = None):             # <<<<<<<<<<<<<<
 *     with open(file_path) as f:
 *         return submit_pipe_code(f.read(), scope)
 */
  __pyx_tuple__107 = PyTuple_Pack(3, __pyx_n_s_file_path, __pyx_n_s_scope, __pyx_n_s_f); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);
  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_submit_pipe_code_from_file, 435, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 435, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":440
 * 
 * 
 * def submit_pipe_code(code: str, scope: str | None = None, priority: int = 0):             # <<<<<<<<<<<<<<
 *     if scope is None:
 *         scope = buelon.worker.DEFAULT_SCOPES.split(',')[-1]
 */
  __pyx_tuple__109 = PyTuple_Pack(5, __pyx_n_s_code, __pyx_n_s_scope, __pyx_n_s_priority, __pyx_n_s_bucket, __pyx_n_s_key); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);
  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_submit_pipe_code, 440, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 440, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":456
 * 
 * 
 * def get_step(step_id: str) -> buelon.core.step.Step | None:             # <<<<<<<<<<<<<<
 *     s = buelon.core.step.Step()
 *     b = bucket_client.get(f'step/{step_id}')
 */
  __pyx_tuple__111 = PyTuple_Pack(4, __pyx_n_s_step_id, __pyx_n_s_s, __pyx_n_s_b, __pyx_n_s_data); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_get_step, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 456, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":465
 * 
 * 
 * def bulk_get_step(step_ids: list[str]) -> dict[str, buelon.core.step.Step | None]:             # <<<<<<<<<<<<<<
 *     output = bucket_client.bulk_get([f'step/{step_id}' for step_id in step_ids])
 *     new_output = {}
 */
  __pyx_tuple__113 = PyTuple_Pack(7, __pyx_n_s_step_ids, __pyx_n_s_output, __pyx_n_s_new_output, __pyx_n_s_k, __pyx_n_s_new_key, __pyx_n_s_s, __pyx_n_s_step_id); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);
  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_bulk_get_step, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 465, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":479
 * 
 * 
 * def set_step(_step: buelon.core.step.Step) -> None:             # <<<<<<<<<<<<<<
 *     b = buelon.helpers.json_parser.dumps(_step.to_json())
 *     bucket_client.set(f'step/{_step.id}', b)
 */
  __pyx_tuple__115 = PyTuple_Pack(2, __pyx_n_s_step_2, __pyx_n_s_b); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);
  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_set_step, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 479, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":484
 * 
 * 
 * def set_steps(steps: list[buelon.core.step.Step]) -> None:             # <<<<<<<<<<<<<<
 *     # if not buelon.bucket.USING_POSTGRES and not buelon.bucket.USING_REDIS:
 *     #     # raise ValueError('set_steps only works with postgres and redis')
 */
  __pyx_tuple__117 = PyTuple_Pack(3, __pyx_n_s_steps, __pyx_n_s_bulk, __pyx_n_s_step_2); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);
  __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_set_steps, 484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 484, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":499
 * 
 * 
 * def remove_step(step_id: str) -> None:             # <<<<<<<<<<<<<<
 *     bucket_client.delete(f'step/{step_id}')
 * 
 */
  __pyx_tuple__119 = PyTuple_Pack(1, __pyx_n_s_step_id); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);
  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_remove_step, 499, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 499, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":503
 * 
 * 
 * def get_data(step_id: str) -> Any:             # <<<<<<<<<<<<<<
 *     key = f'step-data/{step_id}'
 *     v = bucket_client.get(key)
 */
  __pyx_tuple__121 = PyTuple_Pack(3, __pyx_n_s_step_id, __pyx_n_s_key, __pyx_n_s_v); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);
  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_get_data, 503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 503, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":512
 * 
 * 
 * def bulk_get_data(step_ids: list[str]) -> Any:             # <<<<<<<<<<<<<<
 *     output = bucket_client.bulk_get([f'step-data/{step_id}' for step_id in step_ids])
 *     new_output = {}
 */
  __pyx_tuple__123 = PyTuple_Pack(7, __pyx_n_s_step_ids, __pyx_n_s_output, __pyx_n_s_new_output, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_step_id, __pyx_n_s_step_id); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);
  __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_bulk_get_data, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 512, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":523
 * 
 * 
 * def set_data(step_id: str, data: Any) -> None:             # <<<<<<<<<<<<<<
 *     key = f'step-data/{step_id}'
 *     b = buelon.helpers.json_parser.dumps(data)
 */
  __pyx_tuple__125 = PyTuple_Pack(4, __pyx_n_s_step_id, __pyx_n_s_data, __pyx_n_s_key, __pyx_n_s_b); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);
  __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_set_data, 523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 523, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":529
 * 
 * 
 * def bulk_set_data(bulk: dict[str, Any]) -> None:             # <<<<<<<<<<<<<<
 *     new_bulk = {}
 *     for step_id in bulk:
 */
  __pyx_tuple__127 = PyTuple_Pack(3, __pyx_n_s_bulk, __pyx_n_s_new_bulk, __pyx_n_s_step_id); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);
  __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_bulk_set_data, 529, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 529, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":536
 * 
 * 
 * def remove_data(step_id: str) -> None:             # <<<<<<<<<<<<<<
 *     key = f'step-data/{step_id}'
 *     bucket_client.delete(key)
 */
  __pyx_tuple__129 = PyTuple_Pack(2, __pyx_n_s_step_id, __pyx_n_s_key); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);
  __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_remove_data, 536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 536, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":541
 * 
 * 
 * def check_to_delete_bucket_files(             # <<<<<<<<<<<<<<
 *         self: HubServer,
 *         step_id: str,
 */
  __pyx_tuple__131 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_already, __pyx_n_s_steps); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);
  __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_check_to_delete_bucket_files_2, 541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 541, __pyx_L1_error)
  __pyx_tuple__133 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);

  /* "buelon/cython/c_hub.pyx":550
 * 
 * 
 * def _check_to_delete_bucket_files(             # <<<<<<<<<<<<<<
 *     self: HubServer,
 *     step_id: str,
 */
  __pyx_tuple__134 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_already, __pyx_n_s_steps, __pyx_n_s_first_iteration, __pyx_n_s_step_2, __pyx_n_s_parent, __pyx_n_s_child, __pyx_n_s_ids, __pyx_n_s_finished_statuses, __pyx_n_s_sql, __pyx_n_s_rows, __pyx_n_s_s, __pyx_n_s_s, __pyx_n_s_v, __pyx_n_s_row); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);
  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_check_to_delete_bucket_files, 550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 550, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":595
 * 
 * 
 * def _done(self: HubServer, step_id: str):             # <<<<<<<<<<<<<<
 *     _step = get_step(step_id)
 *     sql_update_step = (
 */
  __pyx_tuple__136 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_step_2, __pyx_n_s_sql_update_step, __pyx_n_s_params, __pyx_n_s_sql_update_children, __pyx_n_s_children_params); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);
  __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_done, 595, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(0, 595, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":629
 * 
 * 
 * def _pending(self: HubServer, step_id: str):             # <<<<<<<<<<<<<<
 *     sql_update_step = (
 *         f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.pending.value}\', epoch = ? WHERE id = ?')
 */
  __pyx_tuple__138 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_sql_update_step, __pyx_n_s_params); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(0, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);
  __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_pending_2, 629, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(0, 629, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":640
 * 
 * 
 * def _cancel(             # <<<<<<<<<<<<<<
 *     self: HubServer,
 *     step_id: str,
 */
  __pyx_tuple__140 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_already, __pyx_n_s_first_iteration, __pyx_n_s_step_2, __pyx_n_s_sql_update_step, __pyx_n_s_params, __pyx_n_s_parent, __pyx_n_s_child); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);
  __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_cancel_2, 640, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(0, 640, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":674
 * 
 * 
 * def _reset(self: HubServer, step_id: str, already=None):             # <<<<<<<<<<<<<<
 *     _step = get_step(step_id)
 *     already = set() if not already else already
 */
  __pyx_tuple__142 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_already, __pyx_n_s_step_2, __pyx_n_s_status, __pyx_n_s_sql_update_step, __pyx_n_s_params, __pyx_n_s_child, __pyx_n_s_parent); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);
  __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_reset, 674, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(0, 674, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":702
 * 
 * 
 * def _error(self: HubServer, step_id: str, msg: str, trace: str):             # <<<<<<<<<<<<<<
 *     _step = get_step(step_id)
 *     sql_update_step = (f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.error.value}\', epoch = ?, msg = ?, trace = ? WHERE id = ?')
 */
  __pyx_tuple__144 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_msg, __pyx_n_s_trace, __pyx_n_s_step_2, __pyx_n_s_sql_update_step, __pyx_n_s_params); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);
  __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_error_2, 702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) __PYX_ERR(0, 702, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":715
 * 
 * 
 * def _fetch_errors(self: HubServer, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *     if not isinstance(count, int):
 *         raise ValueError('count must be an integer')
 */
  __pyx_tuple__146 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_count, __pyx_n_s_exclude, __pyx_n_s_allow_chars, __pyx_n_s_clean_query_string, __pyx_n_s_clean_query_string, __pyx_n_s_exclude_query, __pyx_n_s_sql, __pyx_n_s_params, __pyx_n_s_error_size_query, __pyx_n_s_table, __pyx_n_s_error_size, __pyx_n_s_row, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);
  __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_fetch_errors, 715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) __PYX_ERR(0, 715, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":777
 * 
 * 
 * def get_job_statuses(job_ids: str):             # <<<<<<<<<<<<<<
 *     """
 *     Get the hub status of a step.
 */
  __pyx_tuple__148 = PyTuple_Pack(4, __pyx_n_s_job_ids, __pyx_n_s_sql, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(0, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);
  __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_get_job_statuses, 777, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(0, 777, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":800
 * 
 * 
 * def get_step_status(self: HubServer, step_id: str):             # <<<<<<<<<<<<<<
 *     """
 *     Get the hub status of a step.
 */
  __pyx_tuple__150 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_sql, __pyx_n_s_table, __pyx_n_s_row, __pyx_n_s_s, __pyx_n_s_row); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(0, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);
  __pyx_codeobj__151 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__150, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_get_step_status, 800, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(0, 800, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":839
 * 
 * 
 * def get_steps(             # <<<<<<<<<<<<<<
 *     scopes: list,
 *     limit=50,
 */
  __pyx_tuple__152 = PyTuple_Pack(26, __pyx_n_s_scopes, __pyx_n_s_limit, __pyx_n_s_chunk_size, __pyx_n_s_status, __pyx_n_s_include_working, __pyx_n_s_reverse, __pyx_n_s_conn, __pyx_n_s_cur, __pyx_n_s_velocity_sql, __pyx_n_s_tag_velocities, __pyx_n_s_tag, __pyx_n_s_case_statement, __pyx_n_s_offset, __pyx_n_s_steps, __pyx_n_s_expiration_time, __pyx_n_s_working_clause, __pyx_n_s_order_by, __pyx_n_s_sql, __pyx_n_s_rows, __pyx_n_s_row, __pyx_n_s_step_id, __pyx_n_s_priority, __pyx_n_s_scope, __pyx_n_s_velocity, __pyx_n_s_sql_set_to_working, __pyx_n_s_i); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(0, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);
  __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_get_steps, 839, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) __PYX_ERR(0, 839, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":928
 * 
 * 
 * def reset_tag_usage():             # <<<<<<<<<<<<<<
 *     global tag_usage
 *     tag_usage = collections.defaultdict(int)  # {}
 */
  __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_reset_tag_usage, 928, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 928, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":935
 * # Function to decrement tag usage every second
 * 
 * def decrement_tag_usage():             # <<<<<<<<<<<<<<
 *     global tag_usage
 *     while True:
 */
  __pyx_tuple__155 = PyTuple_Pack(1, __pyx_n_s_tag); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);
  __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_decrement_tag_usage, 935, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 935, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":946
 * 
 * class ThreadSafeSQLiteQueue:
 *     def __init__(self, path, auto_commit=True):             # <<<<<<<<<<<<<<
 *         self.path = path
 *         self.auto_commit = auto_commit
 */
  __pyx_tuple__157 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_path, __pyx_n_s_auto_commit); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);
  __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_init, 946, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 946, __pyx_L1_error)
  __pyx_tuple__159 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);

  /* "buelon/cython/c_hub.pyx":951
 *         self.local = threading.local()
 * 
 *     def _get_queue(self):             # <<<<<<<<<<<<<<
 *         if not hasattr(self.local, 'queue'):
 *             self.local.queue = persistqueue.SQLiteQueue(self.path, auto_commit=self.auto_commit)
 */
  __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_get_queue, 951, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 951, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":956
 *         return self.local.queue
 * 
 *     def put(self, item):             # <<<<<<<<<<<<<<
 *         return self._get_queue().put(item)
 * 
 */
  __pyx_tuple__161 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__161);
  __Pyx_GIVEREF(__pyx_tuple__161);
  __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_put, 956, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(0, 956, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":959
 *         return self._get_queue().put(item)
 * 
 *     def get(self):             # <<<<<<<<<<<<<<
 *         return self._get_queue().get()
 * 
 */
  __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_get, 959, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) __PYX_ERR(0, 959, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":962
 *         return self._get_queue().get()
 * 
 *     def task_done(self):             # <<<<<<<<<<<<<<
 *         return self._get_queue().task_done()
 * 
 */
  __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_task_done, 962, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 962, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":965
 *         return self._get_queue().task_done()
 * 
 *     def qsize(self):             # <<<<<<<<<<<<<<
 *         return self._get_queue().qsize()
 * 
 */
  __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_qsize, 965, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(0, 965, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":970
 * 
 * class HubServer:
 *     def __init__(self, host='0.0.0.0', port=65432):             # <<<<<<<<<<<<<<
 *         self.host = host
 *         self.port = port
 */
  __pyx_tuple__166 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_host, __pyx_n_s_port); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);
  __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_init, 970, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) __PYX_ERR(0, 970, __pyx_L1_error)
  __pyx_tuple__168 = PyTuple_Pack(2, ((PyObject*)__pyx_kp_s_0_0_0_0), ((PyObject *)__pyx_int_65432)); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);

  /* "buelon/cython/c_hub.pyx":978
 *         self.db_pool = self.create_db_pool()
 * 
 *     def create_db_pool(self, max_connections=10):             # <<<<<<<<<<<<<<
 *         return ThreadPoolExecutor(max_workers=max_connections)
 * 
 */
  __pyx_tuple__169 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_max_connections); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);
  __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_create_db_pool, 978, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 978, __pyx_L1_error)
  __pyx_tuple__171 = PyTuple_Pack(1, ((PyObject *)__pyx_int_10)); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);

  /* "buelon/cython/c_hub.pyx":981
 *         return ThreadPoolExecutor(max_workers=max_connections)
 * 
 *     def execute_db_query(self, query, params=None, json_table=False):             # <<<<<<<<<<<<<<
 *         def db_operation():
 *             with sqlite3.connect(db_path) as conn:
 */
  __pyx_tuple__172 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_query, __pyx_n_s_params, __pyx_n_s_json_table, __pyx_n_s_db_operation, __pyx_n_s_db_operation); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__172);
  __Pyx_GIVEREF(__pyx_tuple__172);
  __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_execute_db_query, 981, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) __PYX_ERR(0, 981, __pyx_L1_error)
  __pyx_tuple__174 = PyTuple_Pack(2, Py_None, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);

  /* "buelon/cython/c_hub.pyx":998
 *         return self.db_pool.submit(db_operation).result()
 * 
 *     def start(self):             # <<<<<<<<<<<<<<
 *         server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 *         try:
 */
  __pyx_tuple__175 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_server, __pyx_n_s_attempts, __pyx_n_s_attempt, __pyx_n_s_worker_thread, __pyx_n_s_executor_thread, __pyx_n_s_client_socket, __pyx_n_s_addr, __pyx_n_s_client_thread); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);
  __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_start, 998, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(0, 998, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1029
 *             exit()
 * 
 *     def _handle_client(self, client_socket):             # <<<<<<<<<<<<<<
 *         data = receive(client_socket)
 * 
 */
  __pyx_tuple__177 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_client_socket, __pyx_n_s_data, __pyx_n_s_method, __pyx_n_s_payload); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);
  __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_handle_client, 1029, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(0, 1029, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1058
 *         #         traceback.print_exc()
 * 
 *     def _process_transactions(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             method, payload, client_socket = self.transaction_queue.get()
 */
  __pyx_tuple__179 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_method, __pyx_n_s_payload, __pyx_n_s_client_socket, __pyx_n_s_response, __pyx_n_s_e); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 1058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);
  __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_process_transactions, 1058, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 1058, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1089
 *     #             self.execution_queue.task_done()
 * 
 *     def _execute_transaction(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             method, payload = self.execution_queue.get()
 */
  __pyx_tuple__181 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_method, __pyx_n_s_payload, __pyx_n_s_e); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__181);
  __Pyx_GIVEREF(__pyx_tuple__181);
  __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_execute_transaction, 1089, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(0, 1089, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1103
 *                 self.execution_queue.task_done()
 * 
 *     def _execute_request(self, method, payload):             # <<<<<<<<<<<<<<
 *         if method == Method.DONE:
 *             # _done(payload.decode())
 */
  __pyx_tuple__183 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_method, __pyx_n_s_payload, __pyx_n_s_values, __pyx_n_s_step_json, __pyx_n_s_status_value, __pyx_n_s_step_jsons, __pyx_n_s_status_values); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(0, 1103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);
  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_execute_request, 1103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(0, 1103, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1142
 *         raise ValueError(f'Invalid method: {method}')
 * 
 *     def _process_request(self, method: Method, payload: bytes):             # <<<<<<<<<<<<<<
 *         if (method == Method.DONE or method == Method.PENDING or method == Method.CANCEL or method == Method.RESET
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS
 */
  __pyx_tuple__185 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_method, __pyx_n_s_payload, __pyx_n_s_scopes, __pyx_n_s_kwargs, __pyx_n_s_steps, __pyx_n_s_step_id, __pyx_n_s_rows, __pyx_n_s_result, __pyx_n_s_config, __pyx_n_s_count, __pyx_n_s_exclude, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(0, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);
  __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_process_request, 1142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(0, 1142, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1198
 *         return b'ok'
 * 
 *     def get_steps(self, scopes, limit=100, chunk_size=100, status=buelon.core.step.StepStatus.pending.value,             # <<<<<<<<<<<<<<
 *                   include_working=True, reverse=False):
 *         """
 */
  __pyx_tuple__187 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_scopes, __pyx_n_s_limit, __pyx_n_s_chunk_size, __pyx_n_s_status, __pyx_n_s_include_working, __pyx_n_s_reverse, __pyx_n_s_expiration_time, __pyx_n_s_working_clause, __pyx_n_s_order_by, __pyx_n_s_query, __pyx_n_s_params, __pyx_n_s_rows, __pyx_n_s_steps, __pyx_n_s_row, __pyx_n_s_update_query, __pyx_n_s_update_params, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);
  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_get_steps, 1198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(0, 1198, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1299
 * 
 * class HubClient:
 *     def __init__(self, host=None, port=None, max_reconnect_attempts=2):             # <<<<<<<<<<<<<<
 *         self.host = host or os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *         self.port = port or int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */
  __pyx_tuple__189 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_host, __pyx_n_s_port, __pyx_n_s_max_reconnect_attempts); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);
  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_init, 1299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __pyx_tuple__191 = PyTuple_Pack(3, Py_None, Py_None, ((PyObject *)__pyx_int_2)); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);

  /* "buelon/cython/c_hub.pyx":1308
 *             self.load_pg()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         # self.connect()
 *         return self
 */
  __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_enter, 1308, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(0, 1308, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1312
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         pass
 *         # self.close()
 */
  __pyx_tuple__193 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);
  __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_exit_2, 1312, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 1312, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1316
 *         # self.close()
 * 
 *     def connect(self):             # <<<<<<<<<<<<<<
 *         if not self.conn:
 *             self.conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 */
  __pyx_codeobj__195 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_connect, 1316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) __PYX_ERR(0, 1316, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1322
 *             # self.conn.settimeout(60)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if self.conn:
 *             self.conn.close()
 */
  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_close, 1322, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(0, 1322, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1327
 *             self.conn = None
 * 
 *     def send_request(self, method, data: bytes, timeout: int | float = 5, increments: int | float | Callable = 5, attempts: int = 4):             # <<<<<<<<<<<<<<
 *         try:
 *             # socket.setdefaulttimeout(timeout)
 */
  __pyx_tuple__197 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_method, __pyx_n_s_data, __pyx_n_s_timeout, __pyx_n_s_increments, __pyx_n_s_attempts, __pyx_n_s_conn, __pyx_n_s_request, __pyx_n_s_response, __pyx_n_s_e, __pyx_n_s_warnings); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);
  __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_send_request, 1327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(0, 1327, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1374
 *         #         self.connect()  # Establish a new connection before retrying
 * 
 *     def get_steps(self, scopes, **kwargs):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_get_steps(scopes, **kwargs)
 */
  __pyx_tuple__199 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_scopes, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(0, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);
  __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_get_steps, 1374, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(0, 1374, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1379
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.GET_STEPS, buelon.helpers.json_parser.dumps([scopes, kwargs])))
 * 
 *     def get_rows(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_get_rows(step_id)
 */
  __pyx_tuple__201 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_step_id); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);
  __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_get_rows, 1379, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(0, 1379, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1384
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.FETCH_ROWS, buelon.helpers.json_parser.dumps({'step_id': step_id})))
 * 
 *     def done(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_done(step_id)
 */
  __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_done_2, 1384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(0, 1384, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1389
 *         return self.send_request(Method.DONE, step_id.encode())
 * 
 *     def dones(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_dones(steps)
 */
  __pyx_tuple__204 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_steps, __pyx_n_s_step); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__204);
  __Pyx_GIVEREF(__pyx_tuple__204);
  __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_dones, 1389, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(0, 1389, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1395
 *             self.done(step.id)
 * 
 *     def pending(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_pending(step_id)
 */
  __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_pending, 1395, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) __PYX_ERR(0, 1395, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1400
 *         return self.send_request(Method.PENDING, step_id.encode())
 * 
 *     def pendings(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_pendings(steps)
 */
  __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_pendings, 1400, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(0, 1400, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1406
 *             self.pending(step.id)
 * 
 *     def cancel(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_cancel(step_id)
 */
  __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_cancel, 1406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(0, 1406, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1411
 *         return self.send_request(Method.CANCEL, step_id.encode())
 * 
 *     def cancels(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_cancels(steps)
 */
  __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_cancels, 1411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(0, 1411, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1417
 *             self.cancel(step.id)
 * 
 *     def reset(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_reset(step_id)
 */
  __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_reset_2, 1417, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) __PYX_ERR(0, 1417, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1422
 *         return self.send_request(Method.RESET, step_id.encode())
 * 
 *     def resets(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_resets(steps)
 */
  __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_resets, 1422, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(0, 1422, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1428
 *             self.reset(step.id)
 * 
 *     def error(self, step_id, msg, trace):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_error(step_id, msg, trace)
 */
  __pyx_tuple__212 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_msg, __pyx_n_s_trace); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);
  __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__212, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_error, 1428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(0, 1428, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1433
 *         return self.send_request(Method.ERROR, buelon.helpers.json_parser.dumps({'step_id': step_id, 'msg': msg, 'trace': trace}))
 * 
 *     def upload_step(self, step_json, status_value):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_upload_step(step_json, status_value)
 */
  __pyx_tuple__214 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_step_json, __pyx_n_s_status_value); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__214);
  __Pyx_GIVEREF(__pyx_tuple__214);
  __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__214, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_upload_step_3, 1433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) __PYX_ERR(0, 1433, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1438
 *         return self.send_request(Method.UPLOAD_STEP, buelon.helpers.json_parser.dumps([step_json, status_value]))
 * 
 *     def upload_steps(self, step_jsons, status_values):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_upload_steps(step_jsons, status_values)
 */
  __pyx_tuple__216 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_step_jsons, __pyx_n_s_status_values); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(0, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__216);
  __Pyx_GIVEREF(__pyx_tuple__216);
  __pyx_codeobj__217 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__216, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_upload_steps, 1438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__217)) __PYX_ERR(0, 1438, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1443
 *         return self.send_request(Method.UPLOAD_STEPS, buelon.helpers.json_parser.dumps([step_jsons, status_values]))
 * 
 *     def get_step_count(self, types: str | None = None):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_get_step_count(types)
 */
  __pyx_tuple__218 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_types); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(0, 1443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__218);
  __Pyx_GIVEREF(__pyx_tuple__218);
  __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__218, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_get_step_count_2, 1443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(0, 1443, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1455
 *         )
 * 
 *     def reset_errors(self, include_workers: bool):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_reset_errors(include_workers)
 */
  __pyx_tuple__220 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_include_workers); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__220);
  __Pyx_GIVEREF(__pyx_tuple__220);
  __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__220, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_reset_errors_2, 1455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(0, 1455, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1460
 *         return self.send_request(Method.RESET_ERRORS, b'true' if include_workers else b'false', timeout=60 * 10, increments=30)
 * 
 *     def delete_steps(self):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_delete_steps()
 */
  __pyx_codeobj__222 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_delete_steps_3, 1460, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) __PYX_ERR(0, 1460, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1465
 *         return self.send_request(Method.DELETE_STEPS, b'nothing')
 * 
 *     def fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *         """
 * 
 */
  __pyx_tuple__223 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_count, __pyx_n_s_exclude); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(0, 1465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__223);
  __Pyx_GIVEREF(__pyx_tuple__223);
  __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__223, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_fetch_errors_3, 1465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) __PYX_ERR(0, 1465, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1488
 *         )
 * 
 *     def repair(self):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_repair()
 */
  __pyx_tuple__225 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_warnings); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(0, 1488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__225);
  __Pyx_GIVEREF(__pyx_tuple__225);
  __pyx_codeobj__226 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__225, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_repair, 1488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__226)) __PYX_ERR(0, 1488, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1494
 *         warnings.warn('HubClient.repair() is only implemented for postgres')
 * 
 *     def load_pg(self):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_tuple__227 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_q, __pyx_n_s_qs, __pyx_n_s_e); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(0, 1494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__227);
  __Pyx_GIVEREF(__pyx_tuple__227);
  __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__227, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_load_pg, 1494, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) __PYX_ERR(0, 1494, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1537
 *             print('Insufficient privileges to create table.')
 * 
 *     def postgres_get_steps(             # <<<<<<<<<<<<<<
 *             self,
 *             scopes: list[str],
 */
  __pyx_tuple__229 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_scopes, __pyx_n_s_limit, __pyx_n_s_chunk_size, __pyx_n_s_status, __pyx_n_s_include_working, __pyx_n_s_reverse, __pyx_n_s_min_table_size, __pyx_n_s_expiration_time, __pyx_n_s_working_clause, __pyx_n_s_order_by, __pyx_n_s_scope_section, __pyx_n_s_query, __pyx_n_s_rows, __pyx_n_s_check_active_state, __pyx_n_s_check_active_state, __pyx_n_s_thread, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_row); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__229);
  __Pyx_GIVEREF(__pyx_tuple__229);
  __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_get_steps, 1537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) __PYX_ERR(0, 1537, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1667
 *         return [row['id'] for row in rows]
 * 
 *     def postgres_get_rows(self, step_id):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_tuple__231 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_table, __pyx_n_s_row, __pyx_n_s_s, __pyx_n_s_row); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__231);
  __Pyx_GIVEREF(__pyx_tuple__231);
  __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_get_rows, 1667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) __PYX_ERR(0, 1667, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1685
 *         return table
 * 
 *     def postgres_done(self, step_id):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_tuple__233 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_step_2, __pyx_n_s_status, __pyx_n_s_end, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(0, 1685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__233);
  __Pyx_GIVEREF(__pyx_tuple__233);
  __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_done, 1685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) __PYX_ERR(0, 1685, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1701
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 * 
 *     def postgres_dones(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_tuple__235 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_steps, __pyx_n_s_status, __pyx_n_s_where, __pyx_n_s_children, __pyx_n_s_end, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_s, __pyx_n_s_c, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(0, 1701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);
  __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_dones, 1701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) __PYX_ERR(0, 1701, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1722
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 * 
 *     def postgres_pending(self, step_id):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_tuple__237 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_status); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__237);
  __Pyx_GIVEREF(__pyx_tuple__237);
  __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_pending, 1722, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) __PYX_ERR(0, 1722, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1732
 * 
 * 
 *     def postgres_pendings(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_tuple__239 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_steps, __pyx_n_s_status, __pyx_n_s_where, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__239);
  __Pyx_GIVEREF(__pyx_tuple__239);
  __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_pendings, 1732, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(0, 1732, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1743
 * 
 * 
 *     def postgres_cancel(self, step_id: str, __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_tuple__241 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_already_2, __pyx_n_s_first_iteration, __pyx_n_s_step_2, __pyx_n_s_status, __pyx_n_s_parent, __pyx_n_s_child); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(0, 1743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__241);
  __Pyx_GIVEREF(__pyx_tuple__241);
  __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_cancel, 1743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) __PYX_ERR(0, 1743, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1766
 *                     self.postgres_cancel(child, __already)
 * 
 *     def postgres_cancels(self, steps: list[buelon.core.step.Step], __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_tuple__243 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_steps, __pyx_n_s_already_2, __pyx_n_s_first_iteration, __pyx_n_s_where, __pyx_n_s_status, __pyx_n_s_cancels, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_s, __pyx_n_s_p, __pyx_n_s_s, __pyx_n_s_c); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__243);
  __Pyx_GIVEREF(__pyx_tuple__243);
  __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_cancels, 1766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) __PYX_ERR(0, 1766, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1784
 *             self.postgres_cancels(list(bulk_get_step(cancels).values()), __already)
 * 
 *     def postgres_reset(self, step_id, __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_tuple__245 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_already_2, __pyx_n_s_step_2, __pyx_n_s_status, __pyx_n_s_state, __pyx_n_s_child, __pyx_n_s_parent); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(0, 1784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__245);
  __Pyx_GIVEREF(__pyx_tuple__245);
  __pyx_codeobj__246 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_reset, 1784, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) __PYX_ERR(0, 1784, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1807
 *                     self.postgres_reset(parent, __already)
 * 
 *     def postgres_resets(self, steps: list[buelon.core.step.Step], __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_tuple__247 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_steps, __pyx_n_s_already_2, __pyx_n_s_first_iteration, __pyx_n_s_pendings, __pyx_n_s_queued, __pyx_n_s_where, __pyx_n_s_status, __pyx_n_s_resets, __pyx_n_s_s, __pyx_n_s_s, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_s, __pyx_n_s_p, __pyx_n_s_s, __pyx_n_s_c); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(0, 1807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__247);
  __Pyx_GIVEREF(__pyx_tuple__247);
  __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_resets, 1807, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(0, 1807, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1832
 *             self.postgres_resets(list(bulk_get_step(resets).values()), __already)
 * 
 *     def postgres_error(self, step_id, msg, trace):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_tuple__249 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_step_id, __pyx_n_s_msg, __pyx_n_s_trace, __pyx_n_s_db, __pyx_n_s_status, __pyx_n_s_sql_update_step); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(0, 1832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__249);
  __Pyx_GIVEREF(__pyx_tuple__249);
  __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_error, 1832, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) __PYX_ERR(0, 1832, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1843
 *         db.query(sql_update_step)
 * 
 *     def postgres_upload_step(self, step_json, status_value):             # <<<<<<<<<<<<<<
 *         return self.postgres_upload_steps([step_json], [status_value])
 * 
 */
  __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__214, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_upload_step, 1843, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) __PYX_ERR(0, 1843, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1846
 *         return self.postgres_upload_steps([step_json], [status_value])
 * 
 *     def postgres_upload_steps(self, step_jsons, status_values):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_tuple__252 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_step_jsons, __pyx_n_s_status_values, __pyx_n_s_db, __pyx_n_s_sql, __pyx_n_s_values, __pyx_n_s_step_json, __pyx_n_s_status_value, __pyx_n_s_status, __pyx_n_s_step_2, __pyx_n_s_state, __pyx_n_s_params, __pyx_n_s_conn, __pyx_n_s_cur); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(0, 1846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__252);
  __Pyx_GIVEREF(__pyx_tuple__252);
  __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__252, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_upload_steps, 1846, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(0, 1846, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1868
 *             conn.commit()
 * 
 *     def postgres_get_step_count(self, types: str | None = None):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_tuple__254 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_types, __pyx_n_s_db, __pyx_n_s_where, __pyx_n_s_query, __pyx_n_s_table, __pyx_n_s_row); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(0, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__254);
  __Pyx_GIVEREF(__pyx_tuple__254);
  __pyx_codeobj__255 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__254, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_get_step_count, 1868, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) __PYX_ERR(0, 1868, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1898
 *         return table
 * 
 *     def postgres_reset_errors(self, include_workers: bool=False):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 *         suffix = '' if not include_workers else f' or status = \'{buelon.core.step.StepStatus.working.value}\''
 */
  __pyx_tuple__256 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_include_workers, __pyx_n_s_db, __pyx_n_s_suffix, __pyx_n_s_query); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(0, 1898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__256);
  __Pyx_GIVEREF(__pyx_tuple__256);
  __pyx_codeobj__257 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__256, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_reset_errors, 1898, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__257)) __PYX_ERR(0, 1898, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1908
 *         db.query(query)
 * 
 *     def postgres_delete_steps(self):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 *         db.query('delete from buelon_jobs;')
 */
  __pyx_tuple__258 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_db); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(0, 1908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__258);
  __Pyx_GIVEREF(__pyx_tuple__258);
  __pyx_codeobj__259 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__258, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_delete_steps, 1908, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__259)) __PYX_ERR(0, 1908, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1912
 *         db.query('delete from buelon_jobs;')
 * 
 *     def postgres_fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *         try:
 *             count = int(count)
 */
  __pyx_tuple__260 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_count, __pyx_n_s_exclude, __pyx_n_s_allow_chars, __pyx_n_s_clean_query_string, __pyx_n_s_clean_query_string, __pyx_n_s_exclude_query, __pyx_n_s_sql, __pyx_n_s_error_size_query, __pyx_n_s_db, __pyx_n_s_table, __pyx_n_s_error_size, __pyx_n_s_row, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(0, 1912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__260);
  __Pyx_GIVEREF(__pyx_tuple__260);
  __pyx_codeobj__261 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__260, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_fetch_errors, 1912, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__261)) __PYX_ERR(0, 1912, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1957
 *         }
 * 
 *     def postgres_repair(self):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_tuple__262 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_rows, __pyx_n_s_ss, __pyx_n_s_steps, __pyx_n_s_parents, __pyx_n_s_get_statuses, __pyx_n_s_get_statuses, __pyx_n_s_parent_statuses, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_should_finish, __pyx_n_s_should_finish, __pyx_n_s_chunk, __pyx_n_s_s, __pyx_n_s_i, __pyx_n_s_row, __pyx_n_s_d, __pyx_n_s_s, __pyx_n_s_s, __pyx_n_s_p); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(0, 1957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__262);
  __Pyx_GIVEREF(__pyx_tuple__262);
  __pyx_codeobj__263 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__262, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_postgres_repair, 1957, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__263)) __PYX_ERR(0, 1957, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1993
 *             self.dones(chunk)
 * 
 *     def __getattr__(self, item: str):             # <<<<<<<<<<<<<<
 *         if item.startswith('sync_'):
 *             if hasattr(self, item[5:]):
 */
  __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_getattr, 1993, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) __PYX_ERR(0, 1993, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":2000
 * 
 * 
 * def main():             # <<<<<<<<<<<<<<
 *     """
 *     Main function to start the server and worker thread.
 */
  __pyx_tuple__265 = PyTuple_Pack(1, __pyx_n_s_server); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(0, 2000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__265);
  __Pyx_GIVEREF(__pyx_tuple__265);
  __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_buelon_cython_c_hub_pyx, __pyx_n_s_main_2, 2000, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) __PYX_ERR(0, 2000, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
  __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get;
  __pyx_umethod_PyList_Type_clear.type = (PyObject*)&PyList_Type;
  __pyx_umethod_PyList_Type_clear.method_name = &__pyx_n_s_clear;
  __pyx_umethod_PyString_Type_encode.type = (PyObject*)&PyString_Type;
  __pyx_umethod_PyString_Type_encode.method_name = &__pyx_n_s_encode;
  __pyx_umethod_PyString_Type_split.type = (PyObject*)&PyString_Type;
  __pyx_umethod_PyString_Type_split.method_name = &__pyx_n_s_split;
  if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float_5_ = PyFloat_FromDouble(5.); if (unlikely(!__pyx_float_5_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_10_ = PyFloat_FromDouble(10.); if (unlikely(!__pyx_float_10_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_600 = PyInt_FromLong(600); if (unlikely(!__pyx_int_600)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1024 = PyInt_FromLong(1024); if (unlikely(!__pyx_int_1024)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2000 = PyInt_FromLong(2000); if (unlikely(!__pyx_int_2000)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65432 = PyInt_FromLong(65432L); if (unlikely(!__pyx_int_65432)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_globals ### */

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  return 0;
}
/* #### Code section: init_module ### */

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func)) __PYX_ERR(0, 79, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct__timeout_func->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 355, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 355, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 355, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_1_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors)) __PYX_ERR(0, 715, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_2__fetch_errors->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 723, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 723, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 723, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_3_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 728, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 728, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 728, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_4_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr)) __PYX_ERR(0, 736, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_5_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr)) __PYX_ERR(0, 788, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 788, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 788, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_6_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query)) __PYX_ERR(0, 981, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query) < 0) __PYX_ERR(0, 981, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query) < 0) __PYX_ERR(0, 981, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_7_execute_db_query->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr)) __PYX_ERR(0, 1190, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 1190, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 1190, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_8_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr)) __PYX_ERR(0, 1258, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 1258, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 1258, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_9_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr)) __PYX_ERR(0, 1287, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 1287, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 1287, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_10_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr)) __PYX_ERR(0, 1615, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr) < 0) __PYX_ERR(0, 1615, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr) < 0) __PYX_ERR(0, 1615, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_11_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr)) __PYX_ERR(0, 1697, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 1697, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 1697, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_12_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr)) __PYX_ERR(0, 1711, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(0, 1711, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(0, 1711, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_13_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr)) __PYX_ERR(0, 1718, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 1718, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 1718, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_14_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr)) __PYX_ERR(0, 1738, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(0, 1738, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(0, 1738, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_15_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr)) __PYX_ERR(0, 1773, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr) < 0) __PYX_ERR(0, 1773, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr) < 0) __PYX_ERR(0, 1773, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_16_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr)) __PYX_ERR(0, 1817, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr) < 0) __PYX_ERR(0, 1817, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr) < 0) __PYX_ERR(0, 1817, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_17_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr)) __PYX_ERR(0, 1821, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr) < 0) __PYX_ERR(0, 1821, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr) < 0) __PYX_ERR(0, 1821, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_18_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors)) __PYX_ERR(0, 1912, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors) < 0) __PYX_ERR(0, 1912, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors) < 0) __PYX_ERR(0, 1912, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_19_postgres_fetch_errors->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr)) __PYX_ERR(0, 1920, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr) < 0) __PYX_ERR(0, 1920, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr) < 0) __PYX_ERR(0, 1920, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_20_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr)) __PYX_ERR(0, 1928, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr) < 0) __PYX_ERR(0, 1928, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr) < 0) __PYX_ERR(0, 1928, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_21_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr)) __PYX_ERR(0, 1936, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr) < 0) __PYX_ERR(0, 1936, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr) < 0) __PYX_ERR(0, 1936, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_22_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair)) __PYX_ERR(0, 1957, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair) < 0) __PYX_ERR(0, 1957, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair) < 0) __PYX_ERR(0, 1957, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_23_postgres_repair->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr)) __PYX_ERR(0, 1981, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr_spec, __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr) < 0) __PYX_ERR(0, 1981, __pyx_L1_error)
  #else
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr = &__pyx_type_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr) < 0) __PYX_ERR(0, 1981, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr->tp_dictoffset && __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_6buelon_6cython_5c_hub___pyx_scope_struct_24_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_c_hub(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_c_hub},
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "c_hub",
      0, /* m_doc */
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      0, /* m_size */
    #elif CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstate), /* m_size */
    #else
      -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif
#endif

#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initc_hub(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initc_hub(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_c_hub(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_c_hub(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
#else
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
#endif
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
#if CYTHON_COMPILING_IN_LIMITED_API
            result = PyModule_AddObject(module, to_name, value);
#else
            result = PyDict_SetItemString(moddict, to_name, value);
#endif
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    moddict = module;
#else
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
#endif
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_c_hub(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'c_hub' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("c_hub", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #elif CYTHON_USE_MODULE_STATE
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  {
    int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "c_hub" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #endif
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_c_hub(void)", 0);
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  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_buelon__cython__c_hub) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "buelon.cython.c_hub")) {
      if (unlikely((PyDict_SetItemString(modules, "buelon.cython.c_hub", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_type_import_code();
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "buelon/cython/c_hub.pyx":2
 * from __future__ import annotations
 * import asyncio             # <<<<<<<<<<<<<<
 * import enum
 * import traceback
 */
  __pyx_t_2 = __Pyx_patch_asyncio(__Pyx_ImportDottedModule(__pyx_n_s_asyncio, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asyncio, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":3
 * from __future__ import annotations
 * import asyncio
 * import enum             # <<<<<<<<<<<<<<
 * import traceback
 * import sqlite3
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_enum, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_enum, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":4
 * import asyncio
 * import enum
 * import traceback             # <<<<<<<<<<<<<<
 * import sqlite3
 * import os
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_traceback, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_traceback, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":5
 * import enum
 * import traceback
 * import sqlite3             # <<<<<<<<<<<<<<
 * import os
 * import sys
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sqlite3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sqlite3, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":6
 * import traceback
 * import sqlite3
 * import os             # <<<<<<<<<<<<<<
 * import sys
 * import socket
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":7
 * import sqlite3
 * import os
 * import sys             # <<<<<<<<<<<<<<
 * import socket
 * import threading
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":8
 * import os
 * import sys
 * import socket             # <<<<<<<<<<<<<<
 * import threading
 * import queue
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_socket, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_socket, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":9
 * import sys
 * import socket
 * import threading             # <<<<<<<<<<<<<<
 * import queue
 * import time
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_threading, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":10
 * import socket
 * import threading
 * import queue             # <<<<<<<<<<<<<<
 * import time
 * import uuid
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_queue, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":11
 * import threading
 * import queue
 * import time             # <<<<<<<<<<<<<<
 * import uuid
 * import string
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_time, NULL); 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_time, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":12
 * import queue
 * import time
 * import uuid             # <<<<<<<<<<<<<<
 * import string
 * import platform
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_uuid, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uuid, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":13
 * import time
 * import uuid
 * import string             # <<<<<<<<<<<<<<
 * import platform
 * import signal
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_string, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_string, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":14
 * import uuid
 * import string
 * import platform             # <<<<<<<<<<<<<<
 * import signal
 * import collections
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_platform, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_platform, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":15
 * import string
 * import platform
 * import signal             # <<<<<<<<<<<<<<
 * import collections
 * from concurrent.futures import ThreadPoolExecutor
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_signal, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_signal, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":16
 * import platform
 * import signal
 * import collections             # <<<<<<<<<<<<<<
 * from concurrent.futures import ThreadPoolExecutor
 * from typing import Any, Callable
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_collections, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":17
 * import signal
 * import collections
 * from concurrent.futures import ThreadPoolExecutor             # <<<<<<<<<<<<<<
 * from typing import Any, Callable
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_ThreadPoolExecutor);
  __Pyx_GIVEREF(__pyx_n_s_ThreadPoolExecutor);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ThreadPoolExecutor)) __PYX_ERR(0, 17, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_concurrent_futures, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ThreadPoolExecutor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ThreadPoolExecutor, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":18
 * import collections
 * from concurrent.futures import ThreadPoolExecutor
 * from typing import Any, Callable             # <<<<<<<<<<<<<<
 * 
 * import persistqueue
 */
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_Any);
  __Pyx_GIVEREF(__pyx_n_s_Any);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Any)) __PYX_ERR(0, 18, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_Callable);
  __Pyx_GIVEREF(__pyx_n_s_Callable);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Callable)) __PYX_ERR(0, 18, __pyx_L1_error);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Any, __pyx_t_3) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Callable, __pyx_t_3) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":20
 * from typing import Any, Callable
 * 
 * import persistqueue             # <<<<<<<<<<<<<<
 * import unsync
 * import tqdm
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_persistqueue, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_persistqueue, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":21
 * 
 * import persistqueue
 * import unsync             # <<<<<<<<<<<<<<
 * import tqdm
 * try:
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_unsync, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unsync, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":22
 * import persistqueue
 * import unsync
 * import tqdm             # <<<<<<<<<<<<<<
 * try:
 *     import dotenv
 */
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_tqdm, NULL); 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_tqdm, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":23
 * import unsync
 * import tqdm
 * try:             # <<<<<<<<<<<<<<
 *     import dotenv
 *     dotenv.load_dotenv('.env')
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "buelon/cython/c_hub.pyx":24
 * import tqdm
 * try:
 *     import dotenv             # <<<<<<<<<<<<<<
 *     dotenv.load_dotenv('.env')
 * except ModuleNotFoundError:
 */
      __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_dotenv, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_dotenv, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "buelon/cython/c_hub.pyx":25
 * try:
 *     import dotenv
 *     dotenv.load_dotenv('.env')             # <<<<<<<<<<<<<<
 * except ModuleNotFoundError:
 *     pass
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dotenv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_load_dotenv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "buelon/cython/c_hub.pyx":23
 * import unsync
 * import tqdm
 * try:             # <<<<<<<<<<<<<<
 *     import dotenv
 *     dotenv.load_dotenv('.env')
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "buelon/cython/c_hub.pyx":26
 *     import dotenv
 *     dotenv.load_dotenv('.env')
 * except ModuleNotFoundError:             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
    __Pyx_ErrFetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ModuleNotFoundError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 26, __pyx_L4_except_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_2, __pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_ErrRestore(__pyx_t_2, __pyx_t_3, __pyx_t_6);
    __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_6 = 0;
    if (__pyx_t_8) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L3_exception_handled;
    }
    goto __pyx_L4_except_error;

    /* "buelon/cython/c_hub.pyx":23
 * import unsync
 * import tqdm
 * try:             # <<<<<<<<<<<<<<
 *     import dotenv
 *     dotenv.load_dotenv('.env')
 */
    __pyx_L4_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5);
    __pyx_L7_try_end:;
  }

  /* "buelon/cython/c_hub.pyx":29
 *     pass
 * 
 * import buelon.bucket             # <<<<<<<<<<<<<<
 * import buelon.core.step
 * import buelon.core.pipe_interpreter
 */
  __pyx_t_6 = __Pyx_Import(__pyx_n_s_buelon_bucket, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buelon, __pyx_t_6) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":30
 * 
 * import buelon.bucket
 * import buelon.core.step             # <<<<<<<<<<<<<<
 * import buelon.core.pipe_interpreter
 * import buelon.helpers.json_parser
 */
  __pyx_t_6 = __Pyx_Import(__pyx_n_s_buelon_core_step, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buelon, __pyx_t_6) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":31
 * import buelon.bucket
 * import buelon.core.step
 * import buelon.core.pipe_interpreter             # <<<<<<<<<<<<<<
 * import buelon.helpers.json_parser
 * import buelon.core.pipe_debug
 */
  __pyx_t_6 = __Pyx_Import(__pyx_n_s_buelon_core_pipe_interpreter, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buelon, __pyx_t_6) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":32
 * import buelon.core.step
 * import buelon.core.pipe_interpreter
 * import buelon.helpers.json_parser             # <<<<<<<<<<<<<<
 * import buelon.core.pipe_debug
 * import buelon.helpers.lazy_load_class
 */
  __pyx_t_6 = __Pyx_Import(__pyx_n_s_buelon_helpers_json_parser, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buelon, __pyx_t_6) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":33
 * import buelon.core.pipe_interpreter
 * import buelon.helpers.json_parser
 * import buelon.core.pipe_debug             # <<<<<<<<<<<<<<
 * import buelon.helpers.lazy_load_class
 * 
 */
  __pyx_t_6 = __Pyx_Import(__pyx_n_s_buelon_core_pipe_debug, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buelon, __pyx_t_6) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":34
 * import buelon.helpers.json_parser
 * import buelon.core.pipe_debug
 * import buelon.helpers.lazy_load_class             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_6 = __Pyx_Import(__pyx_n_s_buelon_helpers_lazy_load_class, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buelon, __pyx_t_6) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":37
 * 
 * 
 * class Method(enum.Enum):             # <<<<<<<<<<<<<<
 *     GET_STEPS = 'get-steps'
 *     DONE = 'done'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_enum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_Method, __pyx_n_s_Method, (PyObject *) NULL, __pyx_n_s_buelon_cython_c_hub, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_3 != __pyx_t_6) {
    if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 37, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":38
 * 
 * class Method(enum.Enum):
 *     GET_STEPS = 'get-steps'             # <<<<<<<<<<<<<<
 *     DONE = 'done'
 *     PENDING = 'pending'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_GET_STEPS, __pyx_kp_s_get_steps_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":39
 * class Method(enum.Enum):
 *     GET_STEPS = 'get-steps'
 *     DONE = 'done'             # <<<<<<<<<<<<<<
 *     PENDING = 'pending'
 *     CANCEL = 'cancel'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_DONE, __pyx_n_s_done_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":40
 *     GET_STEPS = 'get-steps'
 *     DONE = 'done'
 *     PENDING = 'pending'             # <<<<<<<<<<<<<<
 *     CANCEL = 'cancel'
 *     RESET = 'reset'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_PENDING, __pyx_n_s_pending) < 0) __PYX_ERR(0, 40, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":41
 *     DONE = 'done'
 *     PENDING = 'pending'
 *     CANCEL = 'cancel'             # <<<<<<<<<<<<<<
 *     RESET = 'reset'
 *     ERROR = 'error'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_CANCEL, __pyx_n_s_cancel) < 0) __PYX_ERR(0, 41, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":42
 *     PENDING = 'pending'
 *     CANCEL = 'cancel'
 *     RESET = 'reset'             # <<<<<<<<<<<<<<
 *     ERROR = 'error'
 *     UPLOAD_STEP = 'upload-step'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_RESET, __pyx_n_s_reset_2) < 0) __PYX_ERR(0, 42, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":43
 *     CANCEL = 'cancel'
 *     RESET = 'reset'
 *     ERROR = 'error'             # <<<<<<<<<<<<<<
 *     UPLOAD_STEP = 'upload-step'
 *     UPLOAD_STEPS = 'upload-steps'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_ERROR, __pyx_n_s_error) < 0) __PYX_ERR(0, 43, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":44
 *     RESET = 'reset'
 *     ERROR = 'error'
 *     UPLOAD_STEP = 'upload-step'             # <<<<<<<<<<<<<<
 *     UPLOAD_STEPS = 'upload-steps'
 *     STEP_COUNT = 'step-count'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_UPLOAD_STEP, __pyx_kp_s_upload_step) < 0) __PYX_ERR(0, 44, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":45
 *     ERROR = 'error'
 *     UPLOAD_STEP = 'upload-step'
 *     UPLOAD_STEPS = 'upload-steps'             # <<<<<<<<<<<<<<
 *     STEP_COUNT = 'step-count'
 *     RESET_ERRORS = 'reset-errors'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_UPLOAD_STEPS, __pyx_kp_s_upload_steps_3) < 0) __PYX_ERR(0, 45, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":46
 *     UPLOAD_STEP = 'upload-step'
 *     UPLOAD_STEPS = 'upload-steps'
 *     STEP_COUNT = 'step-count'             # <<<<<<<<<<<<<<
 *     RESET_ERRORS = 'reset-errors'
 *     DELETE_STEPS = 'delete-steps'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_STEP_COUNT, __pyx_kp_s_step_count) < 0) __PYX_ERR(0, 46, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":47
 *     UPLOAD_STEPS = 'upload-steps'
 *     STEP_COUNT = 'step-count'
 *     RESET_ERRORS = 'reset-errors'             # <<<<<<<<<<<<<<
 *     DELETE_STEPS = 'delete-steps'
 *     FETCH_ERRORS = 'fetch-errors'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_RESET_ERRORS, __pyx_kp_s_reset_errors) < 0) __PYX_ERR(0, 47, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":48
 *     STEP_COUNT = 'step-count'
 *     RESET_ERRORS = 'reset-errors'
 *     DELETE_STEPS = 'delete-steps'             # <<<<<<<<<<<<<<
 *     FETCH_ERRORS = 'fetch-errors'
 *     FETCH_ROWS = 'fetch-rows'
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_DELETE_STEPS, __pyx_kp_s_delete_steps) < 0) __PYX_ERR(0, 48, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":49
 *     RESET_ERRORS = 'reset-errors'
 *     DELETE_STEPS = 'delete-steps'
 *     FETCH_ERRORS = 'fetch-errors'             # <<<<<<<<<<<<<<
 *     FETCH_ROWS = 'fetch-rows'
 * 
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_FETCH_ERRORS, __pyx_kp_s_fetch_errors_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":50
 *     DELETE_STEPS = 'delete-steps'
 *     FETCH_ERRORS = 'fetch-errors'
 *     FETCH_ROWS = 'fetch-rows'             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_FETCH_ROWS, __pyx_kp_s_fetch_rows) < 0) __PYX_ERR(0, 50, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":37
 * 
 * 
 * class Method(enum.Enum):             # <<<<<<<<<<<<<<
 *     GET_STEPS = 'get-steps'
 *     DONE = 'done'
 */
  __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Method, __pyx_t_3, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Method, __pyx_t_6) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":53
 * 
 * 
 * USING_POSTGRES = os.environ.get('USING_POSTGRES_HUB', 'false') == 'true'             # <<<<<<<<<<<<<<
 * PIPELINE_HOST = os.environ.get('PIPELINE_HOST', '0.0.0.0')
 * PIPELINE_PORT = int(os.environ.get('PIPELINE_PORT', 65432))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __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_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_n_s_true, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_USING_POSTGRES, __pyx_t_3) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":54
 * 
 * USING_POSTGRES = os.environ.get('USING_POSTGRES_HUB', 'false') == 'true'
 * PIPELINE_HOST = os.environ.get('PIPELINE_HOST', '0.0.0.0')             # <<<<<<<<<<<<<<
 * PIPELINE_PORT = int(os.environ.get('PIPELINE_PORT', 65432))
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __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_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PIPELINE_HOST, __pyx_t_2) < 0) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":55
 * USING_POSTGRES = os.environ.get('USING_POSTGRES_HUB', 'false') == 'true'
 * PIPELINE_HOST = os.environ.get('PIPELINE_HOST', '0.0.0.0')
 * PIPELINE_PORT = int(os.environ.get('PIPELINE_PORT', 65432))             # <<<<<<<<<<<<<<
 * 
 * db_path = os.path.join('database.db')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PIPELINE_PORT, __pyx_t_2) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":57
 * PIPELINE_PORT = int(os.environ.get('PIPELINE_PORT', 65432))
 * 
 * db_path = os.path.join('database.db')             # <<<<<<<<<<<<<<
 * 
 * bucket_client = buelon.bucket.Client()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_db_path, __pyx_t_3) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":59
 * db_path = os.path.join('database.db')
 * 
 * bucket_client = buelon.bucket.Client()             # <<<<<<<<<<<<<<
 * 
 * # Initialize a global tag_usage dictionary
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bucket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __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_Client); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bucket_client, __pyx_t_2) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":62
 * 
 * # Initialize a global tag_usage dictionary
 * tag_usage = collections.defaultdict(int) #{}             # <<<<<<<<<<<<<<
 * tag_lock = threading.Lock()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_collections); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)(&PyInt_Type))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tag_usage, __pyx_t_2) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":63
 * # Initialize a global tag_usage dictionary
 * tag_usage = collections.defaultdict(int) #{}
 * tag_lock = threading.Lock()             # <<<<<<<<<<<<<<
 * 
 * # Create a queue to handle incoming connections
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __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, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tag_lock, __pyx_t_2) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":66
 * 
 * # Create a queue to handle incoming connections
 * connection_queue = queue.Queue()             # <<<<<<<<<<<<<<
 * 
 * PIPELINE_SPLIT_TOKEN = b'|-**-|'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_queue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Queue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_connection_queue, __pyx_t_2) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":68
 * connection_queue = queue.Queue()
 * 
 * PIPELINE_SPLIT_TOKEN = b'|-**-|'             # <<<<<<<<<<<<<<
 * PIPELINE_END_TOKEN = b'[-_-]'
 * LENGTH_OF_PIPELINE_END_TOKEN = len(PIPELINE_END_TOKEN)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PIPELINE_SPLIT_TOKEN, __pyx_kp_b__68) < 0) __PYX_ERR(0, 68, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":69
 * 
 * PIPELINE_SPLIT_TOKEN = b'|-**-|'
 * PIPELINE_END_TOKEN = b'[-_-]'             # <<<<<<<<<<<<<<
 * LENGTH_OF_PIPELINE_END_TOKEN = len(PIPELINE_END_TOKEN)
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PIPELINE_END_TOKEN, __pyx_kp_b__69) < 0) __PYX_ERR(0, 69, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":70
 * PIPELINE_SPLIT_TOKEN = b'|-**-|'
 * PIPELINE_END_TOKEN = b'[-_-]'
 * LENGTH_OF_PIPELINE_END_TOKEN = len(PIPELINE_END_TOKEN)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PIPELINE_END_TOKEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LENGTH_OF_PIPELINE_END_TOKEN, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":74
 * 
 * 
 * def delete_last_line():             # <<<<<<<<<<<<<<
 *     sys.stdout.write("\033[F")
 *     sys.stdout.write("\033[K")
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_1delete_last_line, 0, __pyx_n_s_delete_last_line, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_delete_last_line, __pyx_t_2) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":79
 * 
 * 
 * def timeout_func(func, args=None, kwargs=None, timeout_duration=1, default=None):             # <<<<<<<<<<<<<<
 *     if args is None: args = []
 *     if kwargs is None: kwargs = {}
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_3timeout_func, 0, __pyx_n_s_timeout_func, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__73);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_timeout_func, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":107
 * 
 * 
 * def receive(conn: socket.socket) -> bytes:             # <<<<<<<<<<<<<<
 *     data = b''
 *     while not data.endswith(PIPELINE_END_TOKEN):
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_conn, __pyx_kp_s_socket_socket) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bytes) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_5receive, 0, __pyx_n_s_receive, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_receive, __pyx_t_3) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":120
 * 
 * 
 * def send(conn: socket.socket, data: bytes) -> None:             # <<<<<<<<<<<<<<
 *     conn.sendall(data+PIPELINE_END_TOKEN)
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_conn, __pyx_kp_s_socket_socket) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_data, __pyx_n_s_bytes) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_7send, 0, __pyx_n_s_send, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_send, __pyx_t_2) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":124
 * 
 * 
 * def load_db():             # <<<<<<<<<<<<<<
 *     with sqlite3.connect(db_path) as conn:
 *         cur = conn.cursor()
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9load_db, 0, __pyx_n_s_load_db, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_load_db, __pyx_t_2) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":143
 * 
 * 
 * def delete_steps():             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_11delete_steps, 0, __pyx_n_s_delete_steps_3, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_delete_steps_3, __pyx_t_2) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":155
 * 
 * 
 * def _delete_steps(self: HubServer):             # <<<<<<<<<<<<<<
 *     self.execute_db_query('delete from steps;')
 *     # with sqlite3.connect(db_path) as conn:
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_self, __pyx_n_s_HubServer) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_13_delete_steps, 0, __pyx_n_s_delete_steps_2, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_delete_steps_2, __pyx_t_3) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":163
 * 
 * 
 * def reset_errors(include_workers=False):             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_15reset_errors, 0, __pyx_n_s_reset_errors_2, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__86);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reset_errors_2, __pyx_t_3) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":175
 * 
 * 
 * def _reset_errors(self: HubServer, include_workers=b'false'):             # <<<<<<<<<<<<<<
 *     suffix = '' if include_workers != b'true' else f' or status = \'{buelon.core.step.StepStatus.working.value}\''
 *     query = f'''
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_self, __pyx_n_s_HubServer) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_17_reset_errors, 0, __pyx_n_s_reset_errors_3, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__89);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reset_errors_3, __pyx_t_2) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":189
 * 
 * 
 * def get_step_count(types: str | None = None) -> list[dict]:             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_types, __pyx_kp_s_str_None) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_kp_s_list_dict) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_19get_step_count, 0, __pyx_n_s_get_step_count_2, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__92);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_step_count_2, __pyx_t_3) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":202
 * 
 * 
 * def _get_step_count(self: HubServer, types: str | None = None) -> list[dict]:             # <<<<<<<<<<<<<<
 *     if types == '*':
 *         where = ''
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_self, __pyx_n_s_HubServer) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_types, __pyx_kp_s_str_None) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_list_dict) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_21_get_step_count, 0, __pyx_n_s_get_step_count, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__92);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_step_count, __pyx_t_2) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":241
 * 
 * 
 * def upload_step(_step: buelon.core.step.Step, status: buelon.core.step.StepStatus) -> None:             # <<<<<<<<<<<<<<
 *     WORKER_HOST = os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *     WORKER_PORT = int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_step_2, __pyx_kp_s_buelon_core_step_Step) < 0) __PYX_ERR(0, 241, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_status, __pyx_kp_s_buelon_core_step_StepStatus) < 0) __PYX_ERR(0, 241, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 241, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_23upload_step, 0, __pyx_n_s_upload_step_3, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_upload_step_3, __pyx_t_3) < 0) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":253
 * 
 * 
 * def _upload_step(self: HubServer, step_json: dict, status_value: int) -> None:             # <<<<<<<<<<<<<<
 *     status = buelon.core.step.StepStatus(status_value)
 *     _step: buelon.core.step.Step = buelon.core.step.Step().from_json(step_json)
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_self, __pyx_n_s_HubServer) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_step_json, __pyx_n_s_dict_2) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_status_value, __pyx_n_s_int) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_25_upload_step, 0, __pyx_n_s_upload_step_2, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_upload_step_2, __pyx_t_2) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":268
 * 
 * 
 * def _upload_steps(self: HubServer, step_jsons: list, status_values: list) -> None:             # <<<<<<<<<<<<<<
 *     sql = ('INSERT INTO steps (id, priority, scope, timeout, retries, velocity, tag, status, epoch, msg, trace) '
 *            'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);')
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_self, __pyx_n_s_HubServer) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_step_jsons, __pyx_n_s_list) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_status_values, __pyx_n_s_list) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_27_upload_steps, 0, __pyx_n_s_upload_steps_2, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_upload_steps_2, __pyx_t_3) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":288
 * 
 * 
 * def upload_pipe_code(             # <<<<<<<<<<<<<<
 *         code: str,
 *         lazy_steps: bool = False,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_code, __pyx_n_s_str) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_lazy_steps, __pyx_n_s_bool) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_wait_until_finish, __pyx_n_s_bool) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return_job_ids, __pyx_n_s_bool) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return_job_def_id, __pyx_kp_s_str_list_str_None) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_job_handler, __pyx_kp_s_callable_None) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_str_list_str_tuple_str_list_str) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_29upload_pipe_code, 0, __pyx_n_s_upload_pipe_code, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__103);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_upload_pipe_code, __pyx_t_2) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":429
 * 
 * 
 * def upload_pipe_code_from_file(file_path: str, lazy_steps: bool = False, wait_until_finish: bool = False):             # <<<<<<<<<<<<<<
 *     with open(file_path, 'r') as f:
 *         code = f.read()
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_file_path, __pyx_n_s_str) < 0) __PYX_ERR(0, 429, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lazy_steps, __pyx_n_s_bool) < 0) __PYX_ERR(0, 429, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_wait_until_finish, __pyx_n_s_bool) < 0) __PYX_ERR(0, 429, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_31upload_pipe_code_from_file, 0, __pyx_n_s_upload_pipe_code_from_file, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__106);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_upload_pipe_code_from_file, __pyx_t_3) < 0) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":435
 * 
 * 
 * def submit_pipe_code_from_file(file_path: str, scope: str | None = None):             # <<<<<<<<<<<<<<
 *     with open(file_path) as f:
 *         return submit_pipe_code(f.read(), scope)
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_file_path, __pyx_n_s_str) < 0) __PYX_ERR(0, 435, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_scope, __pyx_kp_s_str_None) < 0) __PYX_ERR(0, 435, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_33submit_pipe_code_from_file, 0, __pyx_n_s_submit_pipe_code_from_file, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__92);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_submit_pipe_code_from_file, __pyx_t_2) < 0) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":440
 * 
 * 
 * def submit_pipe_code(code: str, scope: str | None = None, priority: int = 0):             # <<<<<<<<<<<<<<
 *     if scope is None:
 *         scope = buelon.worker.DEFAULT_SCOPES.split(',')[-1]
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_code, __pyx_n_s_str) < 0) __PYX_ERR(0, 440, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_scope, __pyx_kp_s_str_None) < 0) __PYX_ERR(0, 440, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_priority, __pyx_n_s_int) < 0) __PYX_ERR(0, 440, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_35submit_pipe_code, 0, __pyx_n_s_submit_pipe_code, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 440, __pyx_L1_error)
  if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_3)->__pyx_arg_priority = ((PyObject*)__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_6buelon_6cython_5c_hub_84__defaults__);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_submit_pipe_code, __pyx_t_3) < 0) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":456
 * 
 * 
 * def get_step(step_id: str) -> buelon.core.step.Step | None:             # <<<<<<<<<<<<<<
 *     s = buelon.core.step.Step()
 *     b = bucket_client.get(f'step/{step_id}')
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_step_id, __pyx_n_s_str) < 0) __PYX_ERR(0, 456, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_buelon_core_step_Step_None) < 0) __PYX_ERR(0, 456, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_37get_step, 0, __pyx_n_s_get_step, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_step, __pyx_t_2) < 0) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":465
 * 
 * 
 * def bulk_get_step(step_ids: list[str]) -> dict[str, buelon.core.step.Step | None]:             # <<<<<<<<<<<<<<
 *     output = bucket_client.bulk_get([f'step/{step_id}' for step_id in step_ids])
 *     new_output = {}
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_step_ids, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 465, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_kp_s_dict_str_buelon_core_step_Step_N) < 0) __PYX_ERR(0, 465, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_39bulk_get_step, 0, __pyx_n_s_bulk_get_step, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bulk_get_step, __pyx_t_3) < 0) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":479
 * 
 * 
 * def set_step(_step: buelon.core.step.Step) -> None:             # <<<<<<<<<<<<<<
 *     b = buelon.helpers.json_parser.dumps(_step.to_json())
 *     bucket_client.set(f'step/{_step.id}', b)
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_step_2, __pyx_kp_s_buelon_core_step_Step) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_41set_step, 0, __pyx_n_s_set_step, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_step, __pyx_t_2) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":484
 * 
 * 
 * def set_steps(steps: list[buelon.core.step.Step]) -> None:             # <<<<<<<<<<<<<<
 *     # if not buelon.bucket.USING_POSTGRES and not buelon.bucket.USING_REDIS:
 *     #     # raise ValueError('set_steps only works with postgres and redis')
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_steps, __pyx_kp_s_list_buelon_core_step_Step) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_43set_steps, 0, __pyx_n_s_set_steps, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_steps, __pyx_t_3) < 0) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":499
 * 
 * 
 * def remove_step(step_id: str) -> None:             # <<<<<<<<<<<<<<
 *     bucket_client.delete(f'step/{step_id}')
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_step_id, __pyx_n_s_str) < 0) __PYX_ERR(0, 499, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 499, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_45remove_step, 0, __pyx_n_s_remove_step, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_remove_step, __pyx_t_2) < 0) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":503
 * 
 * 
 * def get_data(step_id: str) -> Any:             # <<<<<<<<<<<<<<
 *     key = f'step-data/{step_id}'
 *     v = bucket_client.get(key)
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_step_id, __pyx_n_s_str) < 0) __PYX_ERR(0, 503, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_Any) < 0) __PYX_ERR(0, 503, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_47get_data, 0, __pyx_n_s_get_data, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_data, __pyx_t_3) < 0) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":512
 * 
 * 
 * def bulk_get_data(step_ids: list[str]) -> Any:             # <<<<<<<<<<<<<<
 *     output = bucket_client.bulk_get([f'step-data/{step_id}' for step_id in step_ids])
 *     new_output = {}
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_step_ids, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Any) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_49bulk_get_data, 0, __pyx_n_s_bulk_get_data, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bulk_get_data, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":523
 * 
 * 
 * def set_data(step_id: str, data: Any) -> None:             # <<<<<<<<<<<<<<
 *     key = f'step-data/{step_id}'
 *     b = buelon.helpers.json_parser.dumps(data)
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_step_id, __pyx_n_s_str) < 0) __PYX_ERR(0, 523, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_data, __pyx_n_s_Any) < 0) __PYX_ERR(0, 523, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 523, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_51set_data, 0, __pyx_n_s_set_data, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_data, __pyx_t_3) < 0) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":529
 * 
 * 
 * def bulk_set_data(bulk: dict[str, Any]) -> None:             # <<<<<<<<<<<<<<
 *     new_bulk = {}
 *     for step_id in bulk:
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bulk, __pyx_kp_s_dict_str_Any) < 0) __PYX_ERR(0, 529, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 529, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_53bulk_set_data, 0, __pyx_n_s_bulk_set_data, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bulk_set_data, __pyx_t_2) < 0) __PYX_ERR(0, 529, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":536
 * 
 * 
 * def remove_data(step_id: str) -> None:             # <<<<<<<<<<<<<<
 *     key = f'step-data/{step_id}'
 *     bucket_client.delete(key)
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_step_id, __pyx_n_s_str) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_55remove_data, 0, __pyx_n_s_remove_data, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_remove_data, __pyx_t_3) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":541
 * 
 * 
 * def check_to_delete_bucket_files(             # <<<<<<<<<<<<<<
 *         self: HubServer,
 *         step_id: str,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_self, __pyx_n_s_HubServer) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_step_id, __pyx_n_s_str) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_already, __pyx_kp_s_set_None) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_steps, __pyx_kp_s_list_None) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_57check_to_delete_bucket_files, 0, __pyx_n_s_check_to_delete_bucket_files_2, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__133);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_to_delete_bucket_files_2, __pyx_t_2) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":550
 * 
 * 
 * def _check_to_delete_bucket_files(             # <<<<<<<<<<<<<<
 *     self: HubServer,
 *     step_id: str,
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_self, __pyx_n_s_HubServer) < 0) __PYX_ERR(0, 550, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_step_id, __pyx_n_s_str) < 0) __PYX_ERR(0, 550, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_already, __pyx_kp_s_set_None) < 0) __PYX_ERR(0, 550, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_steps, __pyx_kp_s_list_None) < 0) __PYX_ERR(0, 550, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 550, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_59_check_to_delete_bucket_files, 0, __pyx_n_s_check_to_delete_bucket_files, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__133);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_to_delete_bucket_files, __pyx_t_3) < 0) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":595
 * 
 * 
 * def _done(self: HubServer, step_id: str):             # <<<<<<<<<<<<<<
 *     _step = get_step(step_id)
 *     sql_update_step = (
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_self, __pyx_n_s_HubServer) < 0) __PYX_ERR(0, 595, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_step_id, __pyx_n_s_str) < 0) __PYX_ERR(0, 595, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_61_done, 0, __pyx_n_s_done, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_done, __pyx_t_2) < 0) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":629
 * 
 * 
 * def _pending(self: HubServer, step_id: str):             # <<<<<<<<<<<<<<
 *     sql_update_step = (
 *         f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.pending.value}\', epoch = ? WHERE id = ?')
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_self, __pyx_n_s_HubServer) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_step_id, __pyx_n_s_str) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_63_pending, 0, __pyx_n_s_pending_2, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pending_2, __pyx_t_3) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":640
 * 
 * 
 * def _cancel(             # <<<<<<<<<<<<<<
 *     self: HubServer,
 *     step_id: str,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_self, __pyx_n_s_HubServer) < 0) __PYX_ERR(0, 640, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_step_id, __pyx_n_s_str) < 0) __PYX_ERR(0, 640, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_already, __pyx_kp_s_set_None) < 0) __PYX_ERR(0, 640, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 640, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_65_cancel, 0, __pyx_n_s_cancel_2, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__92);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cancel_2, __pyx_t_2) < 0) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":674
 * 
 * 
 * def _reset(self: HubServer, step_id: str, already=None):             # <<<<<<<<<<<<<<
 *     _step = get_step(step_id)
 *     already = set() if not already else already
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_self, __pyx_n_s_HubServer) < 0) __PYX_ERR(0, 674, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_step_id, __pyx_n_s_str) < 0) __PYX_ERR(0, 674, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_67_reset, 0, __pyx_n_s_reset, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__92);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reset, __pyx_t_3) < 0) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":702
 * 
 * 
 * def _error(self: HubServer, step_id: str, msg: str, trace: str):             # <<<<<<<<<<<<<<
 *     _step = get_step(step_id)
 *     sql_update_step = (f'UPDATE steps SET status = \'{buelon.core.step.StepStatus.error.value}\', epoch = ?, msg = ?, trace = ? WHERE id = ?')
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_self, __pyx_n_s_HubServer) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_step_id, __pyx_n_s_str) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_msg, __pyx_n_s_str) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_trace, __pyx_n_s_str) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_69_error, 0, __pyx_n_s_error_2, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__145)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_error_2, __pyx_t_2) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":715
 * 
 * 
 * def _fetch_errors(self: HubServer, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *     if not isinstance(count, int):
 *         raise ValueError('count must be an integer')
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_self, __pyx_n_s_HubServer) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_count, __pyx_n_s_int) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_exclude, __pyx_kp_s_list_str_str_None) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_dict_2) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_71_fetch_errors, 0, __pyx_n_s_fetch_errors, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__147)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__92);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fetch_errors, __pyx_t_3) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":777
 * 
 * 
 * def get_job_statuses(job_ids: str):             # <<<<<<<<<<<<<<
 *     """
 *     Get the hub status of a step.
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_job_ids, __pyx_n_s_str) < 0) __PYX_ERR(0, 777, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_73get_job_statuses, 0, __pyx_n_s_get_job_statuses, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__149)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_job_statuses, __pyx_t_2) < 0) __PYX_ERR(0, 777, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":800
 * 
 * 
 * def get_step_status(self: HubServer, step_id: str):             # <<<<<<<<<<<<<<
 *     """
 *     Get the hub status of a step.
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_self, __pyx_n_s_HubServer) < 0) __PYX_ERR(0, 800, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_step_id, __pyx_n_s_str) < 0) __PYX_ERR(0, 800, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_75get_step_status, 0, __pyx_n_s_get_step_status, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__151)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_step_status, __pyx_t_3) < 0) __PYX_ERR(0, 800, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":839
 * 
 * 
 * def get_steps(             # <<<<<<<<<<<<<<
 *     scopes: list,
 *     limit=50,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_scopes, __pyx_n_s_list) < 0) __PYX_ERR(0, 839, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_status, __pyx_n_s_int) < 0) __PYX_ERR(0, 839, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_include_working, __pyx_n_s_bool) < 0) __PYX_ERR(0, 839, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_reverse, __pyx_n_s_bool) < 0) __PYX_ERR(0, 839, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_77get_steps, 0, __pyx_n_s_get_steps, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__153)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 839, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":843
 *     limit=50,
 *     chunk_size=100,
 *     status: int = buelon.core.step.StepStatus.pending.value,             # <<<<<<<<<<<<<<
 *     include_working: bool = True,
 *     reverse: bool=False,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_buelon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_core); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_step); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pending); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_6))) __PYX_ERR(0, 843, __pyx_L1_error)
  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_2)->__pyx_arg_status = ((PyObject*)__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_6buelon_6cython_5c_hub_86__defaults__);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_steps, __pyx_t_2) < 0) __PYX_ERR(0, 839, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":928
 * 
 * 
 * def reset_tag_usage():             # <<<<<<<<<<<<<<
 *     global tag_usage
 *     tag_usage = collections.defaultdict(int)  # {}
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_79reset_tag_usage, 0, __pyx_n_s_reset_tag_usage, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reset_tag_usage, __pyx_t_2) < 0) __PYX_ERR(0, 928, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":935
 * # Function to decrement tag usage every second
 * 
 * def decrement_tag_usage():             # <<<<<<<<<<<<<<
 *     global tag_usage
 *     while True:
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_81decrement_tag_usage, 0, __pyx_n_s_decrement_tag_usage, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__156)); 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_decrement_tag_usage, __pyx_t_2) < 0) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":945
 * 
 * 
 * class ThreadSafeSQLiteQueue:             # <<<<<<<<<<<<<<
 *     def __init__(self, path, auto_commit=True):
 *         self.path = path
 */
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_ThreadSafeSQLiteQueue, __pyx_n_s_ThreadSafeSQLiteQueue, (PyObject *) NULL, __pyx_n_s_buelon_cython_c_hub, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "buelon/cython/c_hub.pyx":946
 * 
 * class ThreadSafeSQLiteQueue:
 *     def __init__(self, path, auto_commit=True):             # <<<<<<<<<<<<<<
 *         self.path = path
 *         self.auto_commit = auto_commit
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_1__init__, 0, __pyx_n_s_ThreadSafeSQLiteQueue___init, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__159);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":951
 *         self.local = threading.local()
 * 
 *     def _get_queue(self):             # <<<<<<<<<<<<<<
 *         if not hasattr(self.local, 'queue'):
 *             self.local.queue = persistqueue.SQLiteQueue(self.path, auto_commit=self.auto_commit)
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_3_get_queue, 0, __pyx_n_s_ThreadSafeSQLiteQueue__get_queue, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_queue, __pyx_t_3) < 0) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":956
 *         return self.local.queue
 * 
 *     def put(self, item):             # <<<<<<<<<<<<<<
 *         return self._get_queue().put(item)
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_5put, 0, __pyx_n_s_ThreadSafeSQLiteQueue_put, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_put, __pyx_t_3) < 0) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":959
 *         return self._get_queue().put(item)
 * 
 *     def get(self):             # <<<<<<<<<<<<<<
 *         return self._get_queue().get()
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_7get, 0, __pyx_n_s_ThreadSafeSQLiteQueue_get, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__163)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get, __pyx_t_3) < 0) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":962
 *         return self._get_queue().get()
 * 
 *     def task_done(self):             # <<<<<<<<<<<<<<
 *         return self._get_queue().task_done()
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_9task_done, 0, __pyx_n_s_ThreadSafeSQLiteQueue_task_done, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_task_done, __pyx_t_3) < 0) __PYX_ERR(0, 962, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":965
 *         return self._get_queue().task_done()
 * 
 *     def qsize(self):             # <<<<<<<<<<<<<<
 *         return self._get_queue().qsize()
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_21ThreadSafeSQLiteQueue_11qsize, 0, __pyx_n_s_ThreadSafeSQLiteQueue_qsize, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_qsize, __pyx_t_3) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":945
 * 
 * 
 * class ThreadSafeSQLiteQueue:             # <<<<<<<<<<<<<<
 *     def __init__(self, path, auto_commit=True):
 *         self.path = path
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_ThreadSafeSQLiteQueue, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ThreadSafeSQLiteQueue, __pyx_t_3) < 0) __PYX_ERR(0, 945, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":969
 * 
 * 
 * class HubServer:             # <<<<<<<<<<<<<<
 *     def __init__(self, host='0.0.0.0', port=65432):
 *         self.host = host
 */
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_HubServer, __pyx_n_s_HubServer, (PyObject *) NULL, __pyx_n_s_buelon_cython_c_hub, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "buelon/cython/c_hub.pyx":970
 * 
 * class HubServer:
 *     def __init__(self, host='0.0.0.0', port=65432):             # <<<<<<<<<<<<<<
 *         self.host = host
 *         self.port = port
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubServer_1__init__, 0, __pyx_n_s_HubServer___init, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__168);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":978
 *         self.db_pool = self.create_db_pool()
 * 
 *     def create_db_pool(self, max_connections=10):             # <<<<<<<<<<<<<<
 *         return ThreadPoolExecutor(max_workers=max_connections)
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubServer_3create_db_pool, 0, __pyx_n_s_HubServer_create_db_pool, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__171);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_create_db_pool, __pyx_t_3) < 0) __PYX_ERR(0, 978, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":981
 *         return ThreadPoolExecutor(max_workers=max_connections)
 * 
 *     def execute_db_query(self, query, params=None, json_table=False):             # <<<<<<<<<<<<<<
 *         def db_operation():
 *             with sqlite3.connect(db_path) as conn:
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubServer_5execute_db_query, 0, __pyx_n_s_HubServer_execute_db_query, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__173)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__174);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_execute_db_query, __pyx_t_3) < 0) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":998
 *         return self.db_pool.submit(db_operation).result()
 * 
 *     def start(self):             # <<<<<<<<<<<<<<
 *         server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 *         try:
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubServer_7start, 0, __pyx_n_s_HubServer_start, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_start, __pyx_t_3) < 0) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":1029
 *             exit()
 * 
 *     def _handle_client(self, client_socket):             # <<<<<<<<<<<<<<
 *         data = receive(client_socket)
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubServer_9_handle_client, 0, __pyx_n_s_HubServer__handle_client, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_handle_client, __pyx_t_3) < 0) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":1058
 *         #         traceback.print_exc()
 * 
 *     def _process_transactions(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             method, payload, client_socket = self.transaction_queue.get()
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubServer_11_process_transactions, 0, __pyx_n_s_HubServer__process_transactions, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_process_transactions, __pyx_t_3) < 0) __PYX_ERR(0, 1058, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":1089
 *     #             self.execution_queue.task_done()
 * 
 *     def _execute_transaction(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             method, payload = self.execution_queue.get()
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubServer_13_execute_transaction, 0, __pyx_n_s_HubServer__execute_transaction, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_execute_transaction, __pyx_t_3) < 0) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":1103
 *                 self.execution_queue.task_done()
 * 
 *     def _execute_request(self, method, payload):             # <<<<<<<<<<<<<<
 *         if method == Method.DONE:
 *             # _done(payload.decode())
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubServer_15_execute_request, 0, __pyx_n_s_HubServer__execute_request, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_execute_request, __pyx_t_3) < 0) __PYX_ERR(0, 1103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "buelon/cython/c_hub.pyx":1142
 *         raise ValueError(f'Invalid method: {method}')
 * 
 *     def _process_request(self, method: Method, payload: bytes):             # <<<<<<<<<<<<<<
 *         if (method == Method.DONE or method == Method.PENDING or method == Method.CANCEL or method == Method.RESET
 *                 or method == Method.ERROR or method == Method.UPLOAD_STEP or method == Method.UPLOAD_STEPS
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_method, __pyx_n_s_Method) < 0) __PYX_ERR(0, 1142, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_payload, __pyx_n_s_bytes) < 0) __PYX_ERR(0, 1142, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubServer_17_process_request, 0, __pyx_n_s_HubServer__process_request, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_process_request, __pyx_t_6) < 0) __PYX_ERR(0, 1142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1198
 *         return b'ok'
 * 
 *     def get_steps(self, scopes, limit=100, chunk_size=100, status=buelon.core.step.StepStatus.pending.value,             # <<<<<<<<<<<<<<
 *                   include_working=True, reverse=False):
 *         """
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubServer_19get_steps, 0, __pyx_n_s_HubServer_get_steps, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_core); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pending); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_6)->__pyx_arg_status = __pyx_t_7;
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_6buelon_6cython_5c_hub_88__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_steps, __pyx_t_6) < 0) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":969
 * 
 * 
 * class HubServer:             # <<<<<<<<<<<<<<
 *     def __init__(self, host='0.0.0.0', port=65432):
 *         self.host = host
 */
  __pyx_t_6 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_HubServer, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_HubServer, __pyx_t_6) < 0) __PYX_ERR(0, 969, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":1298
 * 
 * 
 * class HubClient:             # <<<<<<<<<<<<<<
 *     def __init__(self, host=None, port=None, max_reconnect_attempts=2):
 *         self.host = host or os.environ.get('PIPE_WORKER_HOST', 'localhost')
 */
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_HubClient, __pyx_n_s_HubClient, (PyObject *) NULL, __pyx_n_s_buelon_cython_c_hub, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "buelon/cython/c_hub.pyx":1299
 * 
 * class HubClient:
 *     def __init__(self, host=None, port=None, max_reconnect_attempts=2):             # <<<<<<<<<<<<<<
 *         self.host = host or os.environ.get('PIPE_WORKER_HOST', 'localhost')
 *         self.port = port or int(os.environ.get('PIPE_WORKER_PORT', 65432))
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_1__init__, 0, __pyx_n_s_HubClient___init, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__191);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1308
 *             self.load_pg()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         # self.connect()
 *         return self
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_3__enter__, 0, __pyx_n_s_HubClient___enter, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_enter, __pyx_t_6) < 0) __PYX_ERR(0, 1308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1312
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         pass
 *         # self.close()
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_5__exit__, 0, __pyx_n_s_HubClient___exit, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_exit_2, __pyx_t_6) < 0) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1316
 *         # self.close()
 * 
 *     def connect(self):             # <<<<<<<<<<<<<<
 *         if not self.conn:
 *             self.conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_7connect, 0, __pyx_n_s_HubClient_connect, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__195)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_connect, __pyx_t_6) < 0) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1322
 *             # self.conn.settimeout(60)
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if self.conn:
 *             self.conn.close()
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_9close, 0, __pyx_n_s_HubClient_close, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_close, __pyx_t_6) < 0) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1327
 *             self.conn = None
 * 
 *     def send_request(self, method, data: bytes, timeout: int | float = 5, increments: int | float | Callable = 5, attempts: int = 4):             # <<<<<<<<<<<<<<
 *         try:
 *             # socket.setdefaulttimeout(timeout)
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_data, __pyx_n_s_bytes) < 0) __PYX_ERR(0, 1327, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_timeout, __pyx_kp_s_int_float) < 0) __PYX_ERR(0, 1327, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_increments, __pyx_kp_s_int_float_Callable) < 0) __PYX_ERR(0, 1327, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_attempts, __pyx_n_s_int) < 0) __PYX_ERR(0, 1327, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_11send_request, 0, __pyx_n_s_HubClient_send_request, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults3), 1)) __PYX_ERR(0, 1327, __pyx_L1_error)
  if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_4)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_4))) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_7)->__pyx_arg_attempts = ((PyObject*)__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_6buelon_6cython_5c_hub_90__defaults__);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_send_request, __pyx_t_7) < 0) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1374
 *         #         self.connect()  # Establish a new connection before retrying
 * 
 *     def get_steps(self, scopes, **kwargs):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_get_steps(scopes, **kwargs)
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_13get_steps, 0, __pyx_n_s_HubClient_get_steps, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_steps, __pyx_t_7) < 0) __PYX_ERR(0, 1374, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1379
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.GET_STEPS, buelon.helpers.json_parser.dumps([scopes, kwargs])))
 * 
 *     def get_rows(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_get_rows(step_id)
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_15get_rows, 0, __pyx_n_s_HubClient_get_rows, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_rows, __pyx_t_7) < 0) __PYX_ERR(0, 1379, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1384
 *         return buelon.helpers.json_parser.loads(self.send_request(Method.FETCH_ROWS, buelon.helpers.json_parser.dumps({'step_id': step_id})))
 * 
 *     def done(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_done(step_id)
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_17done, 0, __pyx_n_s_HubClient_done, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__203)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_done_2, __pyx_t_7) < 0) __PYX_ERR(0, 1384, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1389
 *         return self.send_request(Method.DONE, step_id.encode())
 * 
 *     def dones(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_dones(steps)
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_steps, __pyx_kp_s_list_buelon_core_step_Step) < 0) __PYX_ERR(0, 1389, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_19dones, 0, __pyx_n_s_HubClient_dones, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_dones, __pyx_t_6) < 0) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1395
 *             self.done(step.id)
 * 
 *     def pending(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_pending(step_id)
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_21pending, 0, __pyx_n_s_HubClient_pending, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_pending, __pyx_t_6) < 0) __PYX_ERR(0, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1400
 *         return self.send_request(Method.PENDING, step_id.encode())
 * 
 *     def pendings(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_pendings(steps)
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_steps, __pyx_kp_s_list_buelon_core_step_Step) < 0) __PYX_ERR(0, 1400, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_23pendings, 0, __pyx_n_s_HubClient_pendings, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_pendings, __pyx_t_7) < 0) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1406
 *             self.pending(step.id)
 * 
 *     def cancel(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_cancel(step_id)
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_25cancel, 0, __pyx_n_s_HubClient_cancel, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_cancel, __pyx_t_7) < 0) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1411
 *         return self.send_request(Method.CANCEL, step_id.encode())
 * 
 *     def cancels(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_cancels(steps)
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_steps, __pyx_kp_s_list_buelon_core_step_Step) < 0) __PYX_ERR(0, 1411, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_27cancels, 0, __pyx_n_s_HubClient_cancels, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__209)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_cancels, __pyx_t_6) < 0) __PYX_ERR(0, 1411, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1417
 *             self.cancel(step.id)
 * 
 *     def reset(self, step_id):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_reset(step_id)
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_29reset, 0, __pyx_n_s_HubClient_reset, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_reset_2, __pyx_t_6) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1422
 *         return self.send_request(Method.RESET, step_id.encode())
 * 
 *     def resets(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_resets(steps)
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_steps, __pyx_kp_s_list_buelon_core_step_Step) < 0) __PYX_ERR(0, 1422, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_31resets, 0, __pyx_n_s_HubClient_resets, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__211)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_resets, __pyx_t_7) < 0) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1428
 *             self.reset(step.id)
 * 
 *     def error(self, step_id, msg, trace):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_error(step_id, msg, trace)
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_33error, 0, __pyx_n_s_HubClient_error, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__213)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_error, __pyx_t_7) < 0) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1433
 *         return self.send_request(Method.ERROR, buelon.helpers.json_parser.dumps({'step_id': step_id, 'msg': msg, 'trace': trace}))
 * 
 *     def upload_step(self, step_json, status_value):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_upload_step(step_json, status_value)
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_35upload_step, 0, __pyx_n_s_HubClient_upload_step, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__215)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_upload_step_3, __pyx_t_7) < 0) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1438
 *         return self.send_request(Method.UPLOAD_STEP, buelon.helpers.json_parser.dumps([step_json, status_value]))
 * 
 *     def upload_steps(self, step_jsons, status_values):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_upload_steps(step_jsons, status_values)
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_37upload_steps, 0, __pyx_n_s_HubClient_upload_steps, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__217)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_upload_steps, __pyx_t_7) < 0) __PYX_ERR(0, 1438, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1443
 *         return self.send_request(Method.UPLOAD_STEPS, buelon.helpers.json_parser.dumps([step_jsons, status_values]))
 * 
 *     def get_step_count(self, types: str | None = None):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_get_step_count(types)
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_types, __pyx_kp_s_str_None) < 0) __PYX_ERR(0, 1443, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_39get_step_count, 0, __pyx_n_s_HubClient_get_step_count, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__219)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__92);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_step_count_2, __pyx_t_6) < 0) __PYX_ERR(0, 1443, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1455
 *         )
 * 
 *     def reset_errors(self, include_workers: bool):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_reset_errors(include_workers)
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_include_workers, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1455, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_41reset_errors, 0, __pyx_n_s_HubClient_reset_errors, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_reset_errors_2, __pyx_t_7) < 0) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1460
 *         return self.send_request(Method.RESET_ERRORS, b'true' if include_workers else b'false', timeout=60 * 10, increments=30)
 * 
 *     def delete_steps(self):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_delete_steps()
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_43delete_steps, 0, __pyx_n_s_HubClient_delete_steps, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__222)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_delete_steps_3, __pyx_t_7) < 0) __PYX_ERR(0, 1460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1465
 *         return self.send_request(Method.DELETE_STEPS, b'nothing')
 * 
 *     def fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *         """
 * 
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_count, __pyx_n_s_int) < 0) __PYX_ERR(0, 1465, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exclude, __pyx_kp_s_list_str_str_None) < 0) __PYX_ERR(0, 1465, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_dict_2) < 0) __PYX_ERR(0, 1465, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_45fetch_errors, 0, __pyx_n_s_HubClient_fetch_errors, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__224)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__92);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_fetch_errors_3, __pyx_t_6) < 0) __PYX_ERR(0, 1465, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1488
 *         )
 * 
 *     def repair(self):             # <<<<<<<<<<<<<<
 *         if USING_POSTGRES:
 *             return self.postgres_repair()
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_47repair, 0, __pyx_n_s_HubClient_repair, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__226)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repair, __pyx_t_6) < 0) __PYX_ERR(0, 1488, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1494
 *         warnings.warn('HubClient.repair() is only implemented for postgres')
 * 
 *     def load_pg(self):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_49load_pg, 0, __pyx_n_s_HubClient_load_pg, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__228)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_load_pg, __pyx_t_6) < 0) __PYX_ERR(0, 1494, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1537
 *             print('Insufficient privileges to create table.')
 * 
 *     def postgres_get_steps(             # <<<<<<<<<<<<<<
 *             self,
 *             scopes: list[str],
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_scopes, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 1537, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_min_table_size, __pyx_n_s_int) < 0) __PYX_ERR(0, 1537, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_return, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 1537, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_51postgres_get_steps, 0, __pyx_n_s_HubClient_postgres_get_steps, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__230)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults4), 2)) __PYX_ERR(0, 1537, __pyx_L1_error)

  /* "buelon/cython/c_hub.pyx":1542
 *             limit=100,
 *             chunk_size=100,
 *             status=buelon.core.step.StepStatus.pending.value,             # <<<<<<<<<<<<<<
 *             include_working=True,
 *             reverse=False,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_buelon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_core); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_StepStatus); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_pending); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_7)->__pyx_arg_status = __pyx_t_10;
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "buelon/cython/c_hub.pyx":1545
 *             include_working=True,
 *             reverse=False,
 *             min_table_size: int = 2000             # <<<<<<<<<<<<<<
 *     ) -> list[str]:
 *         """
 */
  if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_2000)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_2000))) __PYX_ERR(0, 1545, __pyx_L1_error)
  __Pyx_INCREF(__pyx_int_2000);
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_7)->__pyx_arg_min_table_size = ((PyObject*)__pyx_int_2000);
  __Pyx_GIVEREF(__pyx_int_2000);
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_6buelon_6cython_5c_hub_92__defaults__);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_get_steps, __pyx_t_7) < 0) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1667
 *         return [row['id'] for row in rows]
 * 
 *     def postgres_get_rows(self, step_id):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_53postgres_get_rows, 0, __pyx_n_s_HubClient_postgres_get_rows, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__232)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_get_rows, __pyx_t_7) < 0) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1685
 *         return table
 * 
 *     def postgres_done(self, step_id):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_55postgres_done, 0, __pyx_n_s_HubClient_postgres_done, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__234)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_done, __pyx_t_7) < 0) __PYX_ERR(0, 1685, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1701
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 * 
 *     def postgres_dones(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_steps, __pyx_kp_s_list_buelon_core_step_Step) < 0) __PYX_ERR(0, 1701, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_57postgres_dones, 0, __pyx_n_s_HubClient_postgres_dones, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__236)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_dones, __pyx_t_6) < 0) __PYX_ERR(0, 1701, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1722
 *             self.db.query(f"UPDATE buelon_jobs SET status = \'{status}\', epoch = {time.time()}, state=\'waiting\' WHERE {end}")
 * 
 *     def postgres_pending(self, step_id):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_59postgres_pending, 0, __pyx_n_s_HubClient_postgres_pending, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__238)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_pending, __pyx_t_6) < 0) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1732
 * 
 * 
 *     def postgres_pendings(self, steps: list[buelon.core.step.Step]):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_steps, __pyx_kp_s_list_buelon_core_step_Step) < 0) __PYX_ERR(0, 1732, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_61postgres_pendings, 0, __pyx_n_s_HubClient_postgres_pendings, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_pendings, __pyx_t_7) < 0) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1743
 * 
 * 
 *     def postgres_cancel(self, step_id: str, __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_step_id, __pyx_n_s_str) < 0) __PYX_ERR(0, 1743, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_already_2, __pyx_kp_s_set_None) < 0) __PYX_ERR(0, 1743, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_63postgres_cancel, 0, __pyx_n_s_HubClient_postgres_cancel, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__242)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__92);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_cancel, __pyx_t_6) < 0) __PYX_ERR(0, 1743, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1766
 *                     self.postgres_cancel(child, __already)
 * 
 *     def postgres_cancels(self, steps: list[buelon.core.step.Step], __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_steps, __pyx_kp_s_list_buelon_core_step_Step) < 0) __PYX_ERR(0, 1766, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_already_2, __pyx_kp_s_set_None) < 0) __PYX_ERR(0, 1766, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_65postgres_cancels, 0, __pyx_n_s_HubClient_postgres_cancels, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__244)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__92);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_cancels, __pyx_t_7) < 0) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1784
 *             self.postgres_cancels(list(bulk_get_step(cancels).values()), __already)
 * 
 *     def postgres_reset(self, step_id, __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_already_2, __pyx_kp_s_set_None) < 0) __PYX_ERR(0, 1784, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_67postgres_reset, 0, __pyx_n_s_HubClient_postgres_reset, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__246)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__92);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_reset, __pyx_t_6) < 0) __PYX_ERR(0, 1784, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1807
 *                     self.postgres_reset(parent, __already)
 * 
 *     def postgres_resets(self, steps: list[buelon.core.step.Step], __already: set | None = None):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_steps, __pyx_kp_s_list_buelon_core_step_Step) < 0) __PYX_ERR(0, 1807, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_already_2, __pyx_kp_s_set_None) < 0) __PYX_ERR(0, 1807, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_69postgres_resets, 0, __pyx_n_s_HubClient_postgres_resets, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__92);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_resets, __pyx_t_7) < 0) __PYX_ERR(0, 1807, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1832
 *             self.postgres_resets(list(bulk_get_step(resets).values()), __already)
 * 
 *     def postgres_error(self, step_id, msg, trace):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_71postgres_error, 0, __pyx_n_s_HubClient_postgres_error, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_error, __pyx_t_7) < 0) __PYX_ERR(0, 1832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1843
 *         db.query(sql_update_step)
 * 
 *     def postgres_upload_step(self, step_json, status_value):             # <<<<<<<<<<<<<<
 *         return self.postgres_upload_steps([step_json], [status_value])
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_73postgres_upload_step, 0, __pyx_n_s_HubClient_postgres_upload_step, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__251)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_upload_step, __pyx_t_7) < 0) __PYX_ERR(0, 1843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1846
 *         return self.postgres_upload_steps([step_json], [status_value])
 * 
 *     def postgres_upload_steps(self, step_jsons, status_values):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_75postgres_upload_steps, 0, __pyx_n_s_HubClient_postgres_upload_steps, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__253)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_upload_steps, __pyx_t_7) < 0) __PYX_ERR(0, 1846, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1868
 *             conn.commit()
 * 
 *     def postgres_get_step_count(self, types: str | None = None):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 * 
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_types, __pyx_kp_s_str_None) < 0) __PYX_ERR(0, 1868, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_77postgres_get_step_count, 0, __pyx_n_s_HubClient_postgres_get_step_coun, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__255)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__92);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_get_step_count, __pyx_t_6) < 0) __PYX_ERR(0, 1868, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1898
 *         return table
 * 
 *     def postgres_reset_errors(self, include_workers: bool=False):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 *         suffix = '' if not include_workers else f' or status = \'{buelon.core.step.StepStatus.working.value}\''
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_include_workers, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1898, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_79postgres_reset_errors, 0, __pyx_n_s_HubClient_postgres_reset_errors, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__257)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__86);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_reset_errors, __pyx_t_7) < 0) __PYX_ERR(0, 1898, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1908
 *         db.query(query)
 * 
 *     def postgres_delete_steps(self):             # <<<<<<<<<<<<<<
 *         db = buelon.helpers.postgres.get_postgres_from_env()
 *         db.query('delete from buelon_jobs;')
 */
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_81postgres_delete_steps, 0, __pyx_n_s_HubClient_postgres_delete_steps, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__259)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_delete_steps, __pyx_t_7) < 0) __PYX_ERR(0, 1908, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1912
 *         db.query('delete from buelon_jobs;')
 * 
 *     def postgres_fetch_errors(self, count: int, exclude: list[str] | str | None = None) -> dict:             # <<<<<<<<<<<<<<
 *         try:
 *             count = int(count)
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_count, __pyx_n_s_int) < 0) __PYX_ERR(0, 1912, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_exclude, __pyx_kp_s_list_str_str_None) < 0) __PYX_ERR(0, 1912, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_dict_2) < 0) __PYX_ERR(0, 1912, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_83postgres_fetch_errors, 0, __pyx_n_s_HubClient_postgres_fetch_errors_4, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__261)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__92);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_fetch_errors, __pyx_t_6) < 0) __PYX_ERR(0, 1912, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1957
 *         }
 * 
 *     def postgres_repair(self):             # <<<<<<<<<<<<<<
 *         if not hasattr(self, 'db') or not self.db:
 *             self.db = buelon.helpers.postgres.get_postgres_from_env()
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_85postgres_repair, 0, __pyx_n_s_HubClient_postgres_repair, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__263)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_postgres_repair, __pyx_t_6) < 0) __PYX_ERR(0, 1957, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "buelon/cython/c_hub.pyx":1993
 *             self.dones(chunk)
 * 
 *     def __getattr__(self, item: str):             # <<<<<<<<<<<<<<
 *         if item.startswith('sync_'):
 *             if hasattr(self, item[5:]):
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_item, __pyx_n_s_str) < 0) __PYX_ERR(0, 1993, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_9HubClient_87__getattr__, 0, __pyx_n_s_HubClient___getattr, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__264)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getattr, __pyx_t_7) < 0) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "buelon/cython/c_hub.pyx":1298
 * 
 * 
 * class HubClient:             # <<<<<<<<<<<<<<
 *     def __init__(self, host=None, port=None, max_reconnect_attempts=2):
 *         self.host = host or os.environ.get('PIPE_WORKER_HOST', 'localhost')
 */
  __pyx_t_7 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_HubClient, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_HubClient, __pyx_t_7) < 0) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":2000
 * 
 * 
 * def main():             # <<<<<<<<<<<<<<
 *     """
 *     Main function to start the server and worker thread.
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6buelon_6cython_5c_hub_83main, 0, __pyx_n_s_main_2, NULL, __pyx_n_s_buelon_cython_c_hub, __pyx_d, ((PyObject *)__pyx_codeobj__266)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_main_2, __pyx_t_2) < 0) __PYX_ERR(0, 2000, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "buelon/cython/c_hub.pyx":2015
 * 
 * 
 * if __name__ == "__main__":             # <<<<<<<<<<<<<<
 *     main()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 2015, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_11) {

    /* "buelon/cython/c_hub.pyx":2016
 * 
 * if __name__ == "__main__":
 *     main()             # <<<<<<<<<<<<<<
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_main_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "buelon/cython/c_hub.pyx":2015
 * 
 * 
 * if __name__ == "__main__":             # <<<<<<<<<<<<<<
 *     main()
 */
  }

  /* "buelon/cython/c_hub.pyx":1
 * from __future__ import annotations             # <<<<<<<<<<<<<<
 * import asyncio
 * import enum
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  if (__pyx_m) {
    if (__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init buelon.cython.c_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init buelon.cython.c_hub");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#endif
}
#endif

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

/* PyObjectGetAttrStrNoError */
#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* TupleAndListFromArray */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        Py_INCREF(__pyx_empty_tuple);
        return __pyx_empty_tuple;
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
    for (i = 0; i < n; i++)
    {
        if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
    PyObject *dict;
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#elif CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
        return NULL;
    }
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
        return NULL;
    }
    #endif
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectFastCall */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    #if PY_VERSION_HEX < 0x030800B1
    #if CYTHON_FAST_PYCCALL
    if (PyCFunction_Check(func)) {
        if (kwargs) {
            return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
        } else {
            return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
        }
    }
    #if PY_VERSION_HEX >= 0x030700A1
    if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
        return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
    }
    #endif
    #endif
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
    }
    #endif
    #endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
        #if PY_VERSION_HEX < 0x03090000
        vectorcallfunc f = _PyVectorcall_Function(func);
        #else
        vectorcallfunc f = PyVectorcall_Function(func);
        #endif
        if (f) {
            return f(func, args, (size_t)nargs, NULL);
        }
        #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
        if (__Pyx_CyFunction_CheckExact(func)) {
            __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
            if (f) return f(func, args, (size_t)nargs, NULL);
        }
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject *const *kwvalues,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
    while (1) {
        Py_XDECREF(key); key = NULL;
        Py_XDECREF(value); value = NULL;
        if (kwds_is_tuple) {
            Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(kwds);
#else
            size = PyTuple_Size(kwds);
            if (size < 0) goto bad;
#endif
            if (pos >= size) break;
#if CYTHON_AVOID_BORROWED_REFS
            key = __Pyx_PySequence_ITEM(kwds, pos);
            if (!key) goto bad;
#elif CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kwds, pos);
#else
            key = PyTuple_GetItem(kwds, pos);
            if (!key) goto bad;
#endif
            value = kwvalues[pos];
            pos++;
        }
        else
        {
            if (!PyDict_Next(kwds, &pos, &key, &value)) break;
#if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(key);
#endif
        }
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(value);
            Py_DECREF(key);
#endif
            key = NULL;
            value = NULL;
            continue;
        }
#if !CYTHON_AVOID_BORROWED_REFS
        Py_INCREF(key);
#endif
        Py_INCREF(value);
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
                    value = NULL;
#endif
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key)
                );
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
                    value = NULL;
#endif
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    Py_XDECREF(key);
    Py_XDECREF(value);
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    Py_XDECREF(key);
    Py_XDECREF(value);
    return -1;
}

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

/* RaiseClosureNameError */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* PyObjectCallNoArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    __Pyx_PyThreadState_declare
    CYTHON_UNUSED_VAR(cause);
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
      #if PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
      #elif CYTHON_FAST_THREAD_STATE
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#else
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* PyObjectCallOneArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* Py3UpdateBases */
static PyObject*
__Pyx_PEP560_update_bases(PyObject *bases)
{
    Py_ssize_t i, j, size_bases;
    PyObject *base, *meth, *new_base, *result, *new_bases = NULL;
    size_bases = PyTuple_GET_SIZE(bases);
    for (i = 0; i < size_bases; i++) {
        base  = PyTuple_GET_ITEM(bases, i);
        if (PyType_Check(base)) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries);
        if (!meth && PyErr_Occurred()) {
            goto error;
        }
        if (!meth) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        new_base = __Pyx_PyObject_CallOneArg(meth, bases);
        Py_DECREF(meth);
        if (!new_base) {
            goto error;
        }
        if (!PyTuple_Check(new_base)) {
            PyErr_SetString(PyExc_TypeError,
                            "__mro_entries__ must return a tuple");
            Py_DECREF(new_base);
            goto error;
        }
        if (!new_bases) {
            if (!(new_bases = PyList_New(i))) {
                goto error;
            }
            for (j = 0; j < i; j++) {
                base = PyTuple_GET_ITEM(bases, j);
                PyList_SET_ITEM(new_bases, j, base);
                Py_INCREF(base);
            }
        }
        j = PyList_GET_SIZE(new_bases);
        if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
            goto error;
        }
        Py_DECREF(new_base);
    }
    if (!new_bases) {
        Py_INCREF(bases);
        return bases;
    }
    result = PyList_AsTuple(new_bases);
    Py_DECREF(new_bases);
    return result;
error:
    Py_XDECREF(new_bases);
    return NULL;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases;
#if CYTHON_ASSUME_SAFE_MACROS
    nbases = PyTuple_GET_SIZE(bases);
#else
    nbases = PyTuple_Size(bases);
    if (nbases < 0) return NULL;
#endif
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
#if CYTHON_ASSUME_SAFE_MACROS
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *tmp = PyTuple_GetItem(bases, i);
        if (!tmp) return NULL;
#endif
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* PyObjectCall2Args */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectLookupSpecial */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs[3] = {NULL, name, bases};
            ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
            Py_DECREF(prep);
        } else {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
#if PY_VERSION_HEX >= 0x03030000
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
#else
    CYTHON_MAYBE_UNUSED_VAR(qualname);
#endif
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
static int __Pyx_SetNamesPEP487(PyObject *type_obj) {
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *names_to_set, *key, *value, *set_name, *tmp;
    Py_ssize_t i = 0;
#if CYTHON_USE_TYPE_SLOTS
    names_to_set = PyDict_Copy(type->tp_dict);
#else
    {
        PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict);
        names_to_set = NULL;
        if (likely(d)) {
            PyObject *names_to_set = PyDict_New();
            int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1;
            Py_DECREF(d);
            if (unlikely(ret < 0))
                Py_CLEAR(names_to_set);
        }
    }
#endif
    if (unlikely(names_to_set == NULL))
        goto bad;
    while (PyDict_Next(names_to_set, &i, &key, &value)) {
        set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name);
        if (unlikely(set_name != NULL)) {
            tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key);
            Py_DECREF(set_name);
            if (unlikely(tmp == NULL)) {
                __Pyx_TypeName value_type_name =
                    __Pyx_PyType_GetName(Py_TYPE(value));
                __Pyx_TypeName type_name = __Pyx_PyType_GetName(type);
                PyErr_Format(PyExc_RuntimeError,
#if PY_MAJOR_VERSION >= 3
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name, key, type_name);
#else
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name,
                    PyString_Check(key) ? PyString_AS_STRING(key) : "?",
                    type_name);
#endif
                goto bad;
            } else {
                Py_DECREF(tmp);
            }
        }
        else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
    Py_DECREF(names_to_set);
    return 0;
bad:
    Py_XDECREF(names_to_set);
    return -1;
}
static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) {
#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *mro = type->tp_mro;
    Py_ssize_t i, nbases;
    if (unlikely(!mro)) goto done;
    (void) &__Pyx_GetBuiltinName;
    Py_INCREF(mro);
    nbases = PyTuple_GET_SIZE(mro);
    assert(PyTuple_GET_ITEM(mro, 0) == type_obj);
    for (i = 1; i < nbases-1; i++) {
        PyObject *base, *dict, *meth;
        base = PyTuple_GET_ITEM(mro, i);
        dict = ((PyTypeObject *)base)->tp_dict;
        meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass);
        if (unlikely(meth)) {
            descrgetfunc f = Py_TYPE(meth)->tp_descr_get;
            PyObject *res;
            Py_INCREF(meth);
            if (likely(f)) {
                res = f(meth, NULL, type_obj);
                Py_DECREF(meth);
                if (unlikely(!res)) goto bad;
                meth = res;
            }
            res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw);
            Py_DECREF(meth);
            if (unlikely(!res)) goto bad;
            Py_DECREF(res);
            goto done;
        } else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
done:
    Py_XDECREF(mro);
    return type_obj;
bad:
    Py_XDECREF(mro);
    Py_DECREF(type_obj);
    return NULL;
#else
    PyObject *super_type, *super, *func, *res;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    super_type = __Pyx_GetBuiltinName(__pyx_n_s_super);
#else
    super_type = (PyObject*) &PySuper_Type;
    (void) &__Pyx_GetBuiltinName;
#endif
    super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    Py_XDECREF(super_type);
#endif
    if (unlikely(!super)) {
        Py_CLEAR(type_obj);
        goto done;
    }
    func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass);
    Py_DECREF(super);
    if (likely(!func)) {
        if (unlikely(PyErr_Occurred()))
            Py_CLEAR(type_obj);
        goto done;
    }
    res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw);
    Py_DECREF(func);
    if (unlikely(!res))
        Py_CLEAR(type_obj);
    Py_XDECREF(res);
done:
    return type_obj;
#endif
}
#endif
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result;
    PyObject *owned_metaclass = NULL;
    PyObject *margs[4] = {NULL, name, bases, dict};
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET,
#if PY_VERSION_HEX < 0x030600A4
        (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw
#else
        mkw
#endif
    );
    Py_XDECREF(owned_metaclass);
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
    if (likely(result) && likely(PyType_Check(result))) {
        if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) {
            Py_CLEAR(result);
        } else {
            result = __Pyx_InitSubclassPEP487(result, mkw);
        }
    }
#else
    (void) &__Pyx_GetBuiltinName;
#endif
    return result;
}

/* FixUpExtensionType */
#if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
#else
    const PyType_Slot *slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
        int changed = 0;
#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
        const
#endif
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
#if PY_VERSION_HEX < 0x030900b1
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
#if PY_VERSION_HEX >= 0x030800b4
                    type->tp_vectorcall_offset = memb->offset;
#else
                    type->tp_print = (printfunc) memb->offset;
#endif
                    changed = 1;
                }
#endif
#else
                if ((0));
#endif
#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
                        Py_DECREF(descr);
                        return -1;
                    }
                    Py_DECREF(descr);
                    changed = 1;
                }
#endif
            }
            memb++;
        }
        if (changed)
            PyType_Modified(type);
    }
#endif
    return 0;
}
#endif

/* FetchSharedCythonModule */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
}

/* FetchCommonType */
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t basicsize,
                               Py_ssize_t expected_basicsize) {
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* abi_module;
    const char* object_name;
    PyTypeObject *cached_type = NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    object_name = strrchr(type->tp_name, '.');
    object_name = object_name ? object_name+1 : type->tp_name;
    cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        if (__Pyx_VerifyCachedType(
              (PyObject *)cached_type,
              object_name,
              cached_type->tp_basicsize,
              type->tp_basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    if (PyType_Ready(type) < 0) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
        goto bad;
    Py_INCREF(type);
    cached_type = type;
done:
    Py_DECREF(abi_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#else
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module, *cached_type = NULL;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    cached_type = PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        Py_ssize_t basicsize;
#if CYTHON_COMPILING_IN_LIMITED_API
        PyObject *py_basicsize;
        py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
        if (unlikely(!py_basicsize)) goto bad;
        basicsize = PyLong_AsSsize_t(py_basicsize);
        Py_DECREF(py_basicsize);
        py_basicsize = 0;
        if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
#else
        basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
#endif
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              basicsize,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    CYTHON_UNUSED_VAR(module);
    cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
done:
    Py_DECREF(abi_module);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#endif

/* PyVectorcallFastCallDict */
#if CYTHON_METH_FASTCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i, pos;
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (PyDict_Next(kw, &pos, &key, &value)) {
        keys_are_strings &= Py_TYPE(key)->tp_flags;
        Py_INCREF(key);
        Py_INCREF(value);
        PyTuple_SET_ITEM(kwnames, i, key);
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
        return vc(func, args, nargs, NULL);
    }
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
{
    CYTHON_UNUSED_VAR(closure);
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#elif PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_dict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_tuple;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_kwdict;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->func_annotations;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    int is_coroutine;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
#if PY_VERSION_HEX >= 0x03050000
    if (is_coroutine) {
        PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(marker);
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(op->func_is_coroutine)) {
            return __Pyx_NewRef(op->func_is_coroutine);
        }
ignore:
        PyErr_Clear();
    }
#endif
    op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
    return __Pyx_NewRef(op->func_is_coroutine);
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#if CYTHON_METH_FASTCALL
#if CYTHON_BACKPORT_VECTORCALL
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#endif
#endif
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    CYTHON_UNUSED_VAR(args);
#if PY_MAJOR_VERSION >= 3
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#else
    return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
#if PY_VERSION_HEX < 0x030900B1
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
#endif
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyObject *py_name = NULL;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
    if (!py_name) return NULL;
    PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
                 py_name);
    Py_DECREF(py_name);
#else
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
#endif
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_MACROS
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(!argc) < 0) return NULL;
#endif
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
#if PY_MAJOR_VERSION > 2
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
#else
            PyErr_SetString(PyExc_TypeError,
                            "unbound method needs an argument");
#endif
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
                         ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
        PyErr_Format(PyExc_TypeError,
                     "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
}
#endif
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
#else
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
#if !CYTHON_METH_FASTCALL
    0,
#elif CYTHON_BACKPORT_VECTORCALL
    (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
#else
    offsetof(PyCFunctionObject, vectorcall),
#endif
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_PyMethod_New,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if PY_VERSION_HEX >= 0x030d00A4
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
static int __pyx_CyFunction_init(PyObject *module) {
#if CYTHON_USE_TYPE_SPECS
    __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
#else
    CYTHON_UNUSED_VAR(module);
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
#endif
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    m->defaults_size = size;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
  #endif
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C00A6
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
  #else
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
  #endif
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
    if (unlikely(tstate->current_exception))
#elif CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
      #endif
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
  #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
  #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    CYTHON_MAYBE_UNUSED_VAR(max_char);
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    CYTHON_UNUSED_VAR(value_count);
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* SliceObject */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, int wraparound) {
    __Pyx_TypeName obj_type_name;
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#else
    CYTHON_UNUSED_VAR(wraparound);
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#else
    CYTHON_UNUSED_VAR(wraparound);
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
bad:
    return NULL;
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    type_name = __Pyx_PyType_GetName(type);
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

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

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    return __Pyx_IterFinish();
}

/* RaiseUnboundLocalError */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!j)) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_subscript) {
            PyObject *r, *key = PyInt_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* pep479 */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) {
    PyObject *exc, *val, *tb, *cur_exc;
    __Pyx_PyThreadState_declare
    #ifdef __Pyx_StopAsyncIteration_USED
    int is_async_stopiteration = 0;
    #endif
    CYTHON_MAYBE_UNUSED_VAR(in_async_gen);
    cur_exc = PyErr_Occurred();
    if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) {
        #ifdef __Pyx_StopAsyncIteration_USED
        if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) {
            is_async_stopiteration = 1;
        } else
        #endif
            return;
    }
    __Pyx_PyThreadState_assign
    __Pyx_GetException(&exc, &val, &tb);
    Py_XDECREF(exc);
    Py_XDECREF(val);
    Py_XDECREF(tb);
    PyErr_SetString(PyExc_RuntimeError,
        #ifdef __Pyx_StopAsyncIteration_USED
        is_async_stopiteration ? "async generator raised StopAsyncIteration" :
        in_async_gen ? "async generator raised StopIteration" :
        #endif
        "generator raised StopIteration");
}

/* UnpackUnboundCMethod */
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
     METH_VARARGS | METH_KEYWORDS,
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #else
    if (likely(!__Pyx_CyOrPyCFunction_Check(method)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            target->method = unbound_method;
        }
    }
    return 0;
}

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

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
        
            x = a % b;
            x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyInt_FromLong(x);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return __Pyx_NewRef(op1);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2);
            }
        }
                x = a % b;
                x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla % llb;
                llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
        
            x = (long)((unsigned long)a + (unsigned long)b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return __Pyx_NewRef(op2);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#elif PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod1 */
#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2)
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_GetMethod;
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
#endif
}

/* StringJoin */
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
    (void) __Pyx_PyObject_CallMethod1;
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION < 3
    return _PyString_Join(sep, values);
#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
    return _PyBytes_Join(sep, values);
#else
    return __Pyx_PyObject_CallMethod1(sep, __pyx_n_s_join, values);
#endif
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
    PyObject *runerr = NULL;
    Py_ssize_t key_value;
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = __Pyx_PyObject_GetIterNextFunc(iter);
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
#if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
#include <string.h>
#endif
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#elif PY_MAJOR_VERSION >= 3
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

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

/* PySequenceMultiply */
static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
    PyObject *result, *pymul = PyInt_FromSsize_t(mul);
    if (unlikely(!pymul))
        return NULL;
    result = PyNumber_Multiply(seq, pymul);
    Py_DECREF(pymul);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
#if CYTHON_USE_TYPE_SLOTS
    PyTypeObject *type = Py_TYPE(seq);
    if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
        return type->tp_as_sequence->sq_repeat(seq, mul);
    } else
#endif
    {
        return __Pyx_PySequence_Multiply_Generic(seq, mul);
    }
}

/* pyfrozenset_new */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
    if (it) {
        PyObject* result;
#if CYTHON_COMPILING_IN_PYPY
        PyObject* args;
        args = PyTuple_Pack(1, it);
        if (unlikely(!args))
            return NULL;
        result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
        Py_DECREF(args);
        return result;
#else
        if (PyFrozenSet_CheckExact(it)) {
            Py_INCREF(it);
            return it;
        }
        result = PyFrozenSet_New(it);
        if (unlikely(!result))
            return NULL;
        if ((PY_VERSION_HEX >= 0x031000A1) || likely(PySet_GET_SIZE(result)))
            return result;
        Py_DECREF(result);
#endif
    }
#if CYTHON_USE_TYPE_SLOTS
    return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#else
    return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#endif
}

/* PySetContains */
static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
    int result = -1;
    if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) {
        PyObject *tmpkey;
        PyErr_Clear();
        tmpkey = __Pyx_PyFrozenSet_New(key);
        if (tmpkey != NULL) {
            result = PySet_Contains(set, tmpkey);
            Py_DECREF(tmpkey);
        }
    }
    return result;
}
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) {
    int result = PySet_Contains(set, key);
    if (unlikely(result < 0)) {
        result = __Pyx_PySet_ContainsUnhashable(set, key);
    }
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
                return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
            #else
                return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
            #endif
        } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* CIntToDigits */
static const char DIGIT_PAIRS_10[2*10*10+1] = {
    "00010203040506070809"
    "10111213141516171819"
    "20212223242526272829"
    "30313233343536373839"
    "40414243444546474849"
    "50515253545556575859"
    "60616263646566676869"
    "70717273747576777879"
    "80818283848586878889"
    "90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
    "0001020304050607"
    "1011121314151617"
    "2021222324252627"
    "3031323334353637"
    "4041424344454647"
    "5051525354555657"
    "6061626364656667"
    "7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
    "0123456789abcdef"
    "0123456789ABCDEF"
};

/* BuildPyUnicode */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char) {
    PyObject *uval;
    Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
    Py_ssize_t i;
#if CYTHON_PEP393_ENABLED
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
#else
    Py_UNICODE *udata;
    uval = PyUnicode_FromUnicode(NULL, ulength);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_AS_UNICODE(uval);
#endif
    if (uoffset > 0) {
        i = 0;
        if (prepend_sign) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
            i++;
        }
        for (; i < uoffset; i++) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
        }
    }
    for (i=0; i < clength; i++) {
        __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
    }
#else
    {
        PyObject *sign = NULL, *padding = NULL;
        uval = NULL;
        if (uoffset > 0) {
            prepend_sign = !!prepend_sign;
            if (uoffset > prepend_sign) {
                padding = PyUnicode_FromOrdinal(padding_char);
                if (likely(padding) && uoffset > prepend_sign + 1) {
                    PyObject *tmp;
                    PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
                    if (unlikely(!repeat)) goto done_or_error;
                    tmp = PyNumber_Multiply(padding, repeat);
                    Py_DECREF(repeat);
                    Py_DECREF(padding);
                    padding = tmp;
                }
                if (unlikely(!padding)) goto done_or_error;
            }
            if (prepend_sign) {
                sign = PyUnicode_FromOrdinal('-');
                if (unlikely(!sign)) goto done_or_error;
            }
        }
        uval = PyUnicode_DecodeASCII(chars, clength, NULL);
        if (likely(uval) && padding) {
            PyObject *tmp = PyNumber_Add(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyNumber_Add(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(Py_ssize_t)*3+2];
    char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    Py_ssize_t remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (Py_ssize_t) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (Py_ssize_t) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (Py_ssize_t) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
        
            x = (long)((unsigned long)a - (unsigned long)b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return PyLong_FromLong(-intval);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("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

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (!r) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long b = PyInt_AS_LONG(op2);
        
#ifdef HAVE_LONG_LONG
            if (sizeof(PY_LONG_LONG) > sizeof(long)) {
                PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b;
                return (result >= LONG_MIN && result <= LONG_MAX) ?
                    PyInt_FromLong((long)result) : PyLong_FromLongLong(result);
            }
#endif
#if CYTHON_USE_TYPE_SLOTS
            return PyInt_Type.tp_as_number->nb_multiply(op1, op2);
#else
            return PyNumber_Multiply(op1, op2);
#endif
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
#endif
        if (unlikely(__Pyx_PyLong_IsZero(op2))) {
            return __Pyx_NewRef(op2);
        }
        if (likely(__Pyx_PyLong_IsCompact(op2))) {
            b = __Pyx_PyLong_CompactValue(op2);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op2);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
            }
        }
                CYTHON_UNUSED_VAR(a);
                CYTHON_UNUSED_VAR(b);
                #ifdef HAVE_LONG_LONG
                llb = b;
                goto long_long;
                #else
                return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
                #endif
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla * llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double b = __pyx_PyFloat_AsDouble(op2);
#else
        double b = PyFloat_AS_DOUBLE(op2);
#endif
            double result;
            
            PyFPE_START_PROTECT("multiply", return NULL)
            result = ((double)a) * (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2);
}
#endif

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *empty_list = 0;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (unlikely(!py_import))
        goto bad;
    if (!from_list) {
        empty_list = PyList_New(0);
        if (unlikely(!empty_list))
            goto bad;
        from_list = empty_list;
    }
    #endif
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
                module = PyImport_ImportModuleLevelObject(
                    name, __pyx_d, empty_dict, from_list, 1);
                if (unlikely(!module)) {
                    if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (unlikely(!py_level))
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, __pyx_d, empty_dict, from_list, level);
            #endif
        }
    }
bad:
    Py_XDECREF(empty_dict);
    Py_XDECREF(empty_list);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    return module;
}

/* ImportDottedModule */
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
    PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
    if (unlikely(PyErr_Occurred())) {
        PyErr_Clear();
    }
    if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
        partial_name = name;
    } else {
        slice = PySequence_GetSlice(parts_tuple, 0, count);
        if (unlikely(!slice))
            goto bad;
        sep = PyUnicode_FromStringAndSize(".", 1);
        if (unlikely(!sep))
            goto bad;
        partial_name = PyUnicode_Join(sep, slice);
    }
    PyErr_Format(
#if PY_MAJOR_VERSION < 3
        PyExc_ImportError,
        "No module named '%s'", PyString_AS_STRING(partial_name));
#else
#if PY_VERSION_HEX >= 0x030600B1
        PyExc_ModuleNotFoundError,
#else
        PyExc_ImportError,
#endif
        "No module named '%U'", partial_name);
#endif
bad:
    Py_XDECREF(sep);
    Py_XDECREF(slice);
    Py_XDECREF(partial_name);
    return NULL;
}
#endif
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
    PyObject *imported_module;
#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
    PyObject *modules = PyImport_GetModuleDict();
    if (unlikely(!modules))
        return NULL;
    imported_module = __Pyx_PyDict_GetItemStr(modules, name);
    Py_XINCREF(imported_module);
#else
    imported_module = PyImport_GetModule(name);
#endif
    return imported_module;
}
#endif
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
    Py_ssize_t i, nparts;
    nparts = PyTuple_GET_SIZE(parts_tuple);
    for (i=1; i < nparts && module; i++) {
        PyObject *part, *submodule;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        part = PyTuple_GET_ITEM(parts_tuple, i);
#else
        part = PySequence_ITEM(parts_tuple, i);
#endif
        submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
        Py_DECREF(part);
#endif
        Py_DECREF(module);
        module = submodule;
    }
    if (unlikely(!module)) {
        return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
    }
    return module;
}
#endif
static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if PY_MAJOR_VERSION < 3
    PyObject *module, *from_list, *star = __pyx_kp_s__11;
    CYTHON_UNUSED_VAR(parts_tuple);
    from_list = PyList_New(1);
    if (unlikely(!from_list))
        return NULL;
    Py_INCREF(star);
    PyList_SET_ITEM(from_list, 0, star);
    module = __Pyx_Import(name, from_list, 0);
    Py_DECREF(from_list);
    return module;
#else
    PyObject *imported_module;
    PyObject *module = __Pyx_Import(name, NULL, 0);
    if (!parts_tuple || unlikely(!module))
        return module;
    imported_module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(imported_module)) {
        Py_DECREF(module);
        return imported_module;
    }
    PyErr_Clear();
    return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
#endif
}
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
    PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(module)) {
        PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
        if (likely(spec)) {
            PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
            if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
                Py_DECREF(spec);
                spec = NULL;
            }
            Py_XDECREF(unsafe);
        }
        if (likely(!spec)) {
            PyErr_Clear();
            return module;
        }
        Py_DECREF(spec);
        Py_DECREF(module);
    } else if (PyErr_Occurred()) {
        PyErr_Clear();
    }
#endif
    return __Pyx__ImportDottedModule(name, parts_tuple);
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* UnicodeConcatInPlace */
# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
static int
__Pyx_unicode_modifiable(PyObject *unicode)
{
    if (Py_REFCNT(unicode) != 1)
        return 0;
    if (!PyUnicode_CheckExact(unicode))
        return 0;
    if (PyUnicode_CHECK_INTERNED(unicode))
        return 0;
    return 1;
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right
        #if CYTHON_REFNANNY
        , void* __pyx_refnanny
        #endif
    ) {
    PyObject *left = *p_left;
    Py_ssize_t left_len, right_len, new_len;
    if (unlikely(__Pyx_PyUnicode_READY(left) == -1))
        return NULL;
    if (unlikely(__Pyx_PyUnicode_READY(right) == -1))
        return NULL;
    left_len = PyUnicode_GET_LENGTH(left);
    if (left_len == 0) {
        Py_INCREF(right);
        return right;
    }
    right_len = PyUnicode_GET_LENGTH(right);
    if (right_len == 0) {
        Py_INCREF(left);
        return left;
    }
    if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) {
        PyErr_SetString(PyExc_OverflowError,
                        "strings are too large to concat");
        return NULL;
    }
    new_len = left_len + right_len;
    if (__Pyx_unicode_modifiable(left)
            && PyUnicode_CheckExact(right)
            && PyUnicode_KIND(right) <= PyUnicode_KIND(left)
            && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) {
        int ret;
        __Pyx_GIVEREF(*p_left);
        ret = PyUnicode_Resize(p_left, new_len);
        __Pyx_GOTREF(*p_left);
        if (unlikely(ret != 0))
            return NULL;
        #if PY_VERSION_HEX >= 0x030d0000
        if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL;
        #else
        _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len);
        #endif
        __Pyx_INCREF(*p_left);
        __Pyx_GIVEREF(*p_left);
        return *p_left;
    } else {
        return __Pyx_PyUnicode_Concat(left, right);
    }
  }
#endif

/* PyUnicode_Unicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) {
    if (unlikely(obj == Py_None))
        obj = __pyx_kp_u_None;
    return __Pyx_NewRef(obj);
}

/* 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 PyObject* __Pyx_PyList_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    Py_ssize_t length = PyList_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (length <= 0) {
        return PyList_New(0);
    }
    return __Pyx_PyList_FromArray(((PyListObject*)src)->ob_item + start, length);
}
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    Py_ssize_t length = PyTuple_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    return __Pyx_PyTuple_FromArray(((PyTupleObject*)src)->ob_item + start, length);
}
#endif

/* RaiseMappingExpected */
static void __Pyx_RaiseMappingExpectedError(PyObject* arg) {
    __Pyx_TypeName arg_type_name = __Pyx_PyType_GetName(Py_TYPE(arg));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not a mapping", arg_type_name);
    __Pyx_DECREF_TypeName(arg_type_name);
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    if (likely(cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
            return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
            #else
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
            #endif
        }
        #if PY_VERSION_HEX >= 0x030700A0
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
        #endif
    }
    return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(3);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 1, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 2, arg2);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(3, self, arg1, arg2);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* dict_getitem_default */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
    if ((1));
#else
    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    }
#endif
    else {
        if (default_value == Py_None)
            value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

/* bytes_tailmatch */
static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg,
                                         Py_ssize_t start, Py_ssize_t end, int direction) {
    const char* self_ptr = PyBytes_AS_STRING(self);
    Py_ssize_t self_len = PyBytes_GET_SIZE(self);
    const char* sub_ptr;
    Py_ssize_t sub_len;
    int retval;
    Py_buffer view;
    view.obj = NULL;
    if ( PyBytes_Check(arg) ) {
        sub_ptr = PyBytes_AS_STRING(arg);
        sub_len = PyBytes_GET_SIZE(arg);
    }
#if PY_MAJOR_VERSION < 3
    else if ( PyUnicode_Check(arg) ) {
        return (int) PyUnicode_Tailmatch(self, arg, start, end, direction);
    }
#endif
    else {
        if (unlikely(PyObject_GetBuffer(arg, &view, PyBUF_SIMPLE) == -1))
            return -1;
        sub_ptr = (const char*) view.buf;
        sub_len = view.len;
    }
    if (end > self_len)
        end = self_len;
    else if (end < 0)
        end += self_len;
    if (end < 0)
        end = 0;
    if (start < 0)
        start += self_len;
    if (start < 0)
        start = 0;
    if (direction > 0) {
        if (end-sub_len > start)
            start = end - sub_len;
    }
    if (start + sub_len <= end)
        retval = !memcmp(self_ptr+start, sub_ptr, (size_t)sub_len);
    else
        retval = 0;
    if (view.obj)
        PyBuffer_Release(&view);
    return retval;
}
static int __Pyx_PyBytes_TailmatchTuple(PyObject* self, PyObject* substrings,
                                        Py_ssize_t start, Py_ssize_t end, int direction) {
    Py_ssize_t i, count = PyTuple_GET_SIZE(substrings);
    for (i = 0; i < count; i++) {
        int result;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        result = __Pyx_PyBytes_SingleTailmatch(self, PyTuple_GET_ITEM(substrings, i),
                                               start, end, direction);
#else
        PyObject* sub = PySequence_ITEM(substrings, i);
        if (unlikely(!sub)) return -1;
        result = __Pyx_PyBytes_SingleTailmatch(self, sub, start, end, direction);
        Py_DECREF(sub);
#endif
        if (result) {
            return result;
        }
    }
    return 0;
}
static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr,
                                   Py_ssize_t start, Py_ssize_t end, int direction) {
    if (unlikely(PyTuple_Check(substr))) {
        return __Pyx_PyBytes_TailmatchTuple(self, substr, start, end, direction);
    }
    return __Pyx_PyBytes_SingleTailmatch(self, substr, start, end, direction);
}

/* unicode_tailmatch */
static int __Pyx_PyUnicode_TailmatchTuple(PyObject* s, PyObject* substrings,
                                          Py_ssize_t start, Py_ssize_t end, int direction) {
    Py_ssize_t i, count = PyTuple_GET_SIZE(substrings);
    for (i = 0; i < count; i++) {
        Py_ssize_t result;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        result = PyUnicode_Tailmatch(s, PyTuple_GET_ITEM(substrings, i),
                                     start, end, direction);
#else
        PyObject* sub = PySequence_ITEM(substrings, i);
        if (unlikely(!sub)) return -1;
        result = PyUnicode_Tailmatch(s, sub, start, end, direction);
        Py_DECREF(sub);
#endif
        if (result) {
            return (int) result;
        }
    }
    return 0;
}
static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr,
                                     Py_ssize_t start, Py_ssize_t end, int direction) {
    if (unlikely(PyTuple_Check(substr))) {
        return __Pyx_PyUnicode_TailmatchTuple(s, substr, start, end, direction);
    }
    return (int) PyUnicode_Tailmatch(s, substr, start, end, direction);
}

/* str_tailmatch */
static CYTHON_INLINE int __Pyx_PyStr_Tailmatch(PyObject* self, PyObject* arg, Py_ssize_t start,
                                               Py_ssize_t end, int direction)
{
    if (PY_MAJOR_VERSION < 3)
        return __Pyx_PyBytes_Tailmatch(self, arg, start, end, direction);
    else
        return __Pyx_PyUnicode_Tailmatch(self, arg, start, end, direction);
}

/* ValidateBasesTuple */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_MACROS
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (n < 0) return -1;
#endif
    for (i = 1; i < n; i++)
    {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        PyTypeObject *b;
#if PY_MAJOR_VERSION < 3
        if (PyClass_Check(b0))
        {
            PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
                         PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
        gc = PyImport_GetModule(__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, attr_name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(attr_name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PatchModuleWithCoroutine */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchInspect */
static PyObject* __Pyx_patch_inspect(PyObject* module) {
#if defined(__Pyx_Generator_USED) && (!defined(CYTHON_PATCH_INSPECT) || CYTHON_PATCH_INSPECT)
    static int inspect_patched = 0;
    if (unlikely((!inspect_patched) && module)) {
        module = __Pyx_Coroutine_patch_module(
            module, ""
"old_types = getattr(_module.isgenerator, '_cython_generator_types', None)\n"
"if old_types is None or not isinstance(old_types, set):\n"
"    old_types = set()\n"
"    def cy_wrap(orig_func, type=type, cython_generator_types=old_types):\n"
"        def cy_isgenerator(obj): return type(obj) in cython_generator_types or orig_func(obj)\n"
"        cy_isgenerator._cython_generator_types = cython_generator_types\n"
"        return cy_isgenerator\n"
"    _module.isgenerator = cy_wrap(_module.isgenerator)\n"
"old_types.add(_cython_generator_type)\n"
        );
        inspect_patched = 1;
    }
#else
    if ((0)) return __Pyx_Coroutine_patch_module(module, NULL);
#endif
    return module;
}

/* PatchAsyncIO */
static PyObject* __Pyx_patch_asyncio(PyObject* module) {
#if PY_VERSION_HEX < 0x030500B2 &&\
        (defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED)) &&\
        (!defined(CYTHON_PATCH_ASYNCIO) || CYTHON_PATCH_ASYNCIO)
    PyObject *patch_module = NULL;
    static int asyncio_patched = 0;
    if (unlikely((!asyncio_patched) && module)) {
        PyObject *package;
        package = __Pyx_Import(__pyx_n_s_asyncio_coroutines, NULL, 0);
        if (package) {
            patch_module = __Pyx_Coroutine_patch_module(
                PyObject_GetAttrString(package, "coroutines"), ""
"try:\n"
"    coro_types = _module._COROUTINE_TYPES\n"
"except AttributeError: pass\n"
"else:\n"
"    if _cython_coroutine_type is not None and _cython_coroutine_type not in coro_types:\n"
"        coro_types = tuple(coro_types) + (_cython_coroutine_type,)\n"
"    if _cython_generator_type is not None and _cython_generator_type not in coro_types:\n"
"        coro_types = tuple(coro_types) + (_cython_generator_type,)\n"
"_module._COROUTINE_TYPES = coro_types\n"
            );
        } else {
            PyErr_Clear();
            package = __Pyx_Import(__pyx_n_s_asyncio_tasks, NULL, 0);
            if (unlikely(!package)) goto asyncio_done;
            patch_module = __Pyx_Coroutine_patch_module(
                PyObject_GetAttrString(package, "tasks"), ""
"if hasattr(_module, 'iscoroutine'):\n"
"    old_types = getattr(_module.iscoroutine, '_cython_coroutine_types', None)\n"
"    if old_types is None or not isinstance(old_types, set):\n"
"        old_types = set()\n"
"        def cy_wrap(orig_func, type=type, cython_coroutine_types=old_types):\n"
"            def cy_iscoroutine(obj): return type(obj) in cython_coroutine_types or orig_func(obj)\n"
"            cy_iscoroutine._cython_coroutine_types = cython_coroutine_types\n"
"            return cy_iscoroutine\n"
"        _module.iscoroutine = cy_wrap(_module.iscoroutine)\n"
"    if _cython_coroutine_type is not None:\n"
"        old_types.add(_cython_coroutine_type)\n"
"    if _cython_generator_type is not None:\n"
"        old_types.add(_cython_generator_type)\n"
            );
        }
        Py_DECREF(package);
        if (unlikely(!patch_module)) goto ignore;
asyncio_done:
        PyErr_Clear();
        asyncio_patched = 1;
#ifdef __Pyx_Generator_USED
        {
            PyObject *inspect_module;
            if (patch_module) {
                inspect_module = PyObject_GetAttr(patch_module, __pyx_n_s_inspect);
                Py_DECREF(patch_module);
            } else {
                inspect_module = __Pyx_Import(__pyx_n_s_inspect, NULL, 0);
            }
            if (unlikely(!inspect_module)) goto ignore;
            inspect_module = __Pyx_patch_inspect(inspect_module);
            if (unlikely(!inspect_module)) {
                Py_DECREF(module);
                module = NULL;
            }
            Py_XDECREF(inspect_module);
        }
#else
        if ((0)) return __Pyx_patch_inspect(module);
#endif
    }
    return module;
ignore:
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch asyncio package with custom generator type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    if ((0)) return __Pyx_patch_inspect(__Pyx_Coroutine_patch_module(module, NULL));
#endif
    return module;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        const char* module_name_str = 0;
        PyObject* module_name = 0;
        PyObject* module_dot = 0;
        PyObject* full_name = 0;
        PyErr_Clear();
        module_name_str = PyModule_GetName(module);
        if (unlikely(!module_name_str)) { goto modbad; }
        module_name = PyUnicode_FromString(module_name_str);
        if (unlikely(!module_name)) { goto modbad; }
        module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__14);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}
#endif

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result;
        result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    #if __PYX_LIMITED_VERSION_HEX < 0x030780000
    {
        PyObject *compiled = NULL, *result = NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
        compiled = Py_CompileString(
            "out = type(code)(\n"
            "  code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
            "  code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
            "  code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
            "  code.co_lnotab)\n", "<dummy>", Py_file_input);
        if (!compiled) return NULL;
        result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
        Py_DECREF(compiled);
        if (!result) PyErr_Print();
        Py_DECREF(result);
        result = PyDict_GetItemString(scratch_dict, "out");
        if (result) Py_INCREF(result);
        return result;
    }
    #else
    return NULL;
    #endif
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        (void) __pyx_cfilenm;
        (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
    if (unlikely(!code_object)) goto bad;
    py_py_line = PyLong_FromLong(py_line);
    if (unlikely(!py_py_line)) goto bad;
    py_funcname = PyUnicode_FromString(funcname);
    if (unlikely(!py_funcname)) goto bad;
    dict = PyDict_New();
    if (unlikely(!dict)) goto bad;
    {
        PyObject *old_code_object = code_object;
        code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
        Py_DECREF(old_code_object);
    }
    if (unlikely(!code_object)) goto bad;
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_srcfile = NULL;
    py_srcfile = PyString_FromString(filename);
    if (!py_srcfile) goto bad;
    #endif
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        if (!py_funcname) goto bad;
        #endif
    }
    #if PY_MAJOR_VERSION < 3
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    #else
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    #endif
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_srcfile);
    #endif
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#endif

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* FormatTypeName */
#if CYTHON_COMPILING_IN_LIMITED_API
static __Pyx_TypeName
__Pyx_PyType_GetName(PyTypeObject* tp)
{
    PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_n_s_name_2);
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
        PyErr_Clear();
        Py_XDECREF(name);
        name = __Pyx_NewRef(__pyx_kp_s__22);
    }
    return name;
}
#endif

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(long) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (long) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(long) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(long) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(int) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (int) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(int) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(int) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CoroutineBase */
#include <frameobject.h>
#if PY_VERSION_HEX >= 0x030b00a6
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    CYTHON_UNUSED_VAR(__pyx_tstate);
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_CLEAR(exc_state->exc_value);
#else
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
#endif
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(PyObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    CYTHON_MAYBE_UNUSED_VAR(closing);
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_value) {
        #if CYTHON_COMPILING_IN_PYPY
        #else
        PyObject *exc_tb;
        #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
        exc_tb = PyException_GetTraceback(exc_state->exc_value);
        #elif PY_VERSION_HEX >= 0x030B00a4
        exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback;
        #else
        exc_tb = exc_state->exc_traceback;
        #endif
        if (exc_tb) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
            PyFrameObject *f = tb->tb_frame;
            assert(f->f_back == NULL);
            #if PY_VERSION_HEX >= 0x030B00A1
            f->f_back = PyThreadState_GetFrame(tstate);
            #else
            Py_XINCREF(tstate->frame);
            f->f_back = tstate->frame;
            #endif
            #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
            Py_DECREF(exc_tb);
            #endif
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body(self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
#if CYTHON_COMPILING_IN_PYPY
    CYTHON_UNUSED_VAR(exc_state);
#else
    PyObject *exc_tb;
    #if PY_VERSION_HEX >= 0x030B00a4
    if (!exc_state->exc_value) return;
    exc_tb = PyException_GetTraceback(exc_state->exc_value);
    #else
    exc_tb = exc_state->exc_traceback;
    #endif
    if (likely(exc_tb)) {
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
        #if PY_VERSION_HEX >= 0x030B00a4
        Py_DECREF(exc_tb);
        #endif
    }
#endif
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
#if PY_VERSION_HEX < 0x030d00A1
            _PyGen_SetStopIterationValue(result);
#else
            if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) {
                PyErr_SetObject(PyExc_StopIteration, result);
            } else {
                PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result);
                if (likely(exc != NULL)) {
                    PyErr_SetObject(PyExc_StopIteration, exc);
                    Py_DECREF(exc);
                }
            }
#endif
        }
        Py_DECREF(result);
        result = NULL;
    }
    return result;
#endif
}
#endif
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (unlikely(PyErr_Occurred())) {
                PyErr_WriteUnraisable(yf);
            }
        } else {
            retval = __Pyx_PyObject_CallNoArg(meth);
            Py_DECREF(meth);
            if (unlikely(!retval))
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (unlikely(PyErr_Occurred())) {
                    gen->is_running = 0;
                    return NULL;
                }
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = __Pyx_PyObject_Call(meth, args, NULL);
            } else {
                PyObject *cargs[4] = {NULL, typ, val, tb};
                ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_VISIT(exc_state->exc_value);
#else
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
#endif
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_frame);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (unlikely(PyObject_CallFinalizerFromDealloc(self)))
#else
        Py_TYPE(gen)->tp_del(self);
        if (unlikely(Py_REFCNT(self) > 0))
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    __Pyx_PyHeapTypeObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    __Pyx_SET_REFCNT(self, 1);
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(Py_REFCNT(self) > 0);
    if (likely(--self->ob_refcnt == 0)) {
        return;
    }
    {
        Py_ssize_t refcnt = Py_REFCNT(self);
        _Py_NewReference(self);
        __Pyx_SET_REFCNT(self, refcnt);
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(Py_TYPE(self)) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_name;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_name, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_qualname;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_qualname, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context)
{
    PyObject *frame = self->gi_frame;
    CYTHON_UNUSED_VAR(context);
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            __pyx_d,                 /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        if (unlikely(!frame))
            return NULL;
        self->gi_frame = frame;
    }
    Py_INCREF(frame);
    return frame;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    #if PY_VERSION_HEX >= 0x030B00a4
    gen->gi_exc_state.exc_value = NULL;
    #else
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
    #endif
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    gen->gi_frame = NULL;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchGeneratorABC */
#ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (unlikely(!module)) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     (char*) PyDoc_STR("Frame of the generator"), 0},
    {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_GeneratorType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
    {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
    {Py_tp_iter, (void *)PyObject_SelfIter},
    {Py_tp_iternext, (void *)__Pyx_Generator_Next},
    {Py_tp_methods, (void *)__pyx_Generator_methods},
    {Py_tp_members, (void *)__pyx_Generator_memberlist},
    {Py_tp_getset, (void *)__pyx_Generator_getsets},
    {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict},
#if CYTHON_USE_TP_FINALIZE
    {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
#endif
    {0, 0},
};
static PyType_Spec __pyx_GeneratorType_spec = {
    __PYX_TYPE_MODULE_PREFIX "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    __pyx_GeneratorType_slots
};
#else
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if PY_VERSION_HEX >= 0x030d00A4
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
static int __pyx_Generator_init(PyObject *module) {
#if CYTHON_USE_TYPE_SPECS
    __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL);
#else
    CYTHON_UNUSED_VAR(module);
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
#endif
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
    return Py_Version & ~0xFFUL;
#else
    const char* rt_version = Py_GetVersion();
    unsigned long version = 0;
    unsigned long factor = 0x01000000UL;
    unsigned int digit = 0;
    int i = 0;
    while (factor) {
        while ('0' <= rt_version[i] && rt_version[i] <= '9') {
            digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
            ++i;
        }
        version += factor * digit;
        if (rt_version[i] != '.')
            break;
        digit = 0;
        factor >>= 8;
        ++i;
    }
    return version;
#endif
}
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* InitStrings */
#if PY_MAJOR_VERSION >= 3
static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
    if (t.is_unicode | t.is_str) {
        if (t.intern) {
            *str = PyUnicode_InternFromString(t.s);
        } else if (t.encoding) {
            *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
        } else {
            *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
        }
    } else {
        *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
    }
    if (!*str)
        return -1;
    if (PyObject_Hash(*str) == -1)
        return -1;
    return 0;
}
#endif
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION >= 3
        __Pyx_InitString(*t, t->p);
        #else
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        #endif
        ++t;
    }
    return 0;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
                 type_name, type_name, result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
#if PY_MAJOR_VERSION < 3
  } else if (likely(PyInt_CheckExact(o))) {
    return PyInt_AS_LONG(o);
#endif
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyInt_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
